mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Replace apropos/licence/charte sticky nav with responsive details/summary TOC
- Convert .apropos-toc <nav> to <details class="toc" open> in all three templates - Add caret-down icon to summary (visible only on mobile via media queries) - Desktop (≥768px): sticky sidebar via CSS grid, force-open via pointer-events:none, hide caret - Mobile (≤767px): single column, collapsible TOC with rotating caret, margin-top below search bar - Rename .apropos-toc-link to .toc-sidebar-link - Merge 900px and 600px breakpoints into single 600px mobile media query - Rename apropos.css → content-page.css; update 3 controller references
This commit is contained in:
446
app/public/assets/css/content-page.css
Normal file
446
app/public/assets/css/content-page.css
Normal file
@@ -0,0 +1,446 @@
|
||||
/* ============================================================
|
||||
À PROPOS / CHARTE / LICENCE pages
|
||||
Root class: .page-content
|
||||
============================================================ */
|
||||
|
||||
/* Override inherited padding on main-content */
|
||||
#main-content {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.page-content {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
scroll-behavior: smooth;
|
||||
padding: var(--space-xl) var(--space-l) var(--space-2xl);
|
||||
display: grid;
|
||||
grid-template-columns: 180px 1fr;
|
||||
gap: var(--space-2xl);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Table of contents — details/summary block */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.toc {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.toc[open] {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.toc > :not(summary) {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.toc summary {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--step-1);
|
||||
font-weight: 400;
|
||||
color: var(--text-primary);
|
||||
padding: 0 0 var(--space-2xs) 0;
|
||||
border-bottom: 1px solid var(--text-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2xs);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.toc summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toc summary:hover {
|
||||
color: inherit;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Caret icon inside summary — visible only on mobile */
|
||||
.toc-caret {
|
||||
flex-shrink: 0;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
|
||||
.toc[open] > summary .toc-caret {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.toc ul {
|
||||
list-style: none;
|
||||
margin: var(--space-xs) 0 0 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3xs);
|
||||
}
|
||||
|
||||
.toc ul a {
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--step-0);
|
||||
font-weight: 300;
|
||||
color: var(--text-primary);
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
padding: var(--space-3xs) 0;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
|
||||
.toc ul a:hover {
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
/* Sidebar links (about page) */
|
||||
.toc-sidebar-link:first-of-type {
|
||||
padding-top: var(--space-s);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.toc-sidebar-link + .toc-sidebar-link {
|
||||
padding-top: var(--space-xs);
|
||||
}
|
||||
|
||||
.toc-sidebar-link a {
|
||||
font-size: var(--step--2);
|
||||
color: var(--accent-primary);
|
||||
text-decoration: none;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
|
||||
.toc-sidebar-link a:hover {
|
||||
color: var(--accent-primary);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Desktop: force-open TOC, hide caret, sticky sidebar */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.toc {
|
||||
position: sticky;
|
||||
top: var(--space-l);
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.toc summary {
|
||||
pointer-events: none;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.toc summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.toc-caret {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.page-content > .content,
|
||||
.page-content > .content-section {
|
||||
grid-column: 2;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Mobile: collapsible TOC */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.page-content {
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--space-l);
|
||||
padding: var(--space-m) var(--space-s) var(--space-xl);
|
||||
}
|
||||
|
||||
.toc {
|
||||
margin-top: var(--space-s);
|
||||
position: static;
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.page-content > .content,
|
||||
.page-content > .content-section {
|
||||
grid-column: 1;
|
||||
}
|
||||
|
||||
.toc summary {
|
||||
cursor: pointer;
|
||||
list-style: revert;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Main content area */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/* Shared typography for about-page sections and charte/licence content */
|
||||
.content,
|
||||
.content-section {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
font-family: var(--font-body);
|
||||
font-size: var(--step-0);
|
||||
line-height: 1.6;
|
||||
color: var(--text-primary);
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.content *,
|
||||
.content-section * {
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding-bottom: var(--space-xl);
|
||||
}
|
||||
|
||||
.content p,
|
||||
.content-section p {
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
.content p:last-child,
|
||||
.content-section p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.content :where(h1, h2, h3),
|
||||
.content-section :where(h1, h2, h3) {
|
||||
margin: 1.5em 0 0.5em 0;
|
||||
}
|
||||
|
||||
.content :where(h1, h2, h3):first-child,
|
||||
.content-section :where(h1, h2, h3):first-child {
|
||||
margin-top: 2.2rem;
|
||||
}
|
||||
|
||||
.content a,
|
||||
.content-section a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.content a:hover,
|
||||
.content-section a:hover {
|
||||
color: var(--accent-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.content ul,
|
||||
.content ol,
|
||||
.content-section ul,
|
||||
.content-section ol {
|
||||
padding-left: var(--space-m);
|
||||
margin-bottom: var(--space-s);
|
||||
}
|
||||
|
||||
.content li,
|
||||
.content-section li {
|
||||
margin-bottom: 0.3em;
|
||||
}
|
||||
|
||||
.content strong,
|
||||
.content-section strong {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.content em,
|
||||
.content-section em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.content :where(pre, pre code, code),
|
||||
.content-section :where(pre, pre code, code) {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overflow-wrap: normal;
|
||||
word-break: normal;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
font-size: 0.88em;
|
||||
background: color-mix(in srgb, var(--bg-tertiary) 50%, transparent);
|
||||
padding: 0.5em 0.75em;
|
||||
border-radius: var(--radius);
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#apropos-intro *,
|
||||
#apropos-contacts *,
|
||||
#apropos-credits * {
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Section separators (about page only — .content-section adds dividers) */
|
||||
.page-content > .content-section {
|
||||
padding-bottom: var(--space-xl);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
margin-bottom: var(--space-xl);
|
||||
}
|
||||
|
||||
.page-content > .content-section:last-child {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: var(--space-xl);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Section titles */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.content-section-title {
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--step-3);
|
||||
font-weight: 400;
|
||||
color: var(--text-primary);
|
||||
margin: 0 0 var(--space-m) 0;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
/* Scroll margin so anchor links account for the sticky header */
|
||||
.content :where(h1, h2, h3),
|
||||
.content-section :where(h1, h2, h3) {
|
||||
scroll-margin-top: var(--space-l);
|
||||
}
|
||||
|
||||
/* Hide CommonMark heading permalink anchors (id now lives on the heading itself) */
|
||||
.heading-permalink {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Contacts grid */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.apropos-contacts-grid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.apropos-contact-card {
|
||||
font-style: normal;
|
||||
padding: var(--space-s) 0;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.apropos-contact-card:first-child {
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.apropos-contact-card strong {
|
||||
display: block;
|
||||
font-size: var(--step-0);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: var(--space-3xs);
|
||||
}
|
||||
|
||||
.apropos-contact-card span {
|
||||
display: block;
|
||||
font-size: var(--step--1);
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.4;
|
||||
margin-bottom: var(--space-3xs);
|
||||
}
|
||||
|
||||
.apropos-contact-card a {
|
||||
font-size: var(--step--1);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-weight: 700;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
|
||||
.apropos-contact-card a:hover {
|
||||
color: var(--accent-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Credits list */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.apropos-credits-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.apropos-credit-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1.6fr;
|
||||
gap: var(--space-s);
|
||||
padding: var(--space-s) 0;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.apropos-credit-row:first-child {
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.apropos-credits-list dt {
|
||||
font-size: var(--step--2);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.apropos-credits-list dd {
|
||||
font-size: var(--step--1);
|
||||
color: var(--text-primary);
|
||||
margin: 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Single-column layout — used by licence.php (no sidebar) */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.apropos-single {
|
||||
max-width: 720px;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Responsive — small mobile */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.page-content {
|
||||
padding: var(--space-m) var(--space-s) var(--space-xl);
|
||||
}
|
||||
|
||||
.content-section {
|
||||
font-size: var(--step-0);
|
||||
}
|
||||
|
||||
.content-section-title {
|
||||
font-size: var(--step-2);
|
||||
}
|
||||
|
||||
.apropos-credit-row {
|
||||
grid-template-columns: 1fr;
|
||||
gap: var(--space-3xs);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user