Führe eine konfigurierbare Größenskala für Website und Vorschau ein

Zehn Basiswerte (Fließtext, Überschriften, Abstände, Kopfzeile, Inhaltsbreite, Bildhöhe) leiten in tokens.css alle Größen ab. Einstieg, Bild und Text, Premium-Karten, Karten, Kopf, Fuß und Schaltflächen verwenden nur noch diese Tokens. Die Werte sind unter Website, Design, Größen einstellbar und wirken ohne Deployment über ein Inline-Stylesheet in Website, Mitgliederbereich-Layout und CMS-Vorschau. Lesen fällt bei fehlender Tabelle oder beschädigten Daten auf die Standardwerte zurück. Die Migration ist rein ergänzend.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-11-22 14:54:14 +01:00
1 parent e0a3fdbb70
commit 67614158e4
23 files changed
+1110 -111

No files matched your search

+98 -32
View File
@@ -76,28 +76,68 @@ :root {
--lf-font-ui: var(--font-reading);
--lf-muted: #46556b;
/* Typografie (Website-Zielkonzept 7.2: Fließtext 17 → 18 px, H1 34 → 52 px) */
/*
* Größenskala (ADR-44). Zehn Basiswerte in Pixel als Zahl; alles Weitere leitet dieses Stylesheet daraus ab.
* Die Verwaltung („Website → Design → Größen“) überschreibt abweichende Werte mit einem Inline-Stylesheet
* (App\Domain\Design\DesignSettings::styleTag) nach diesem Stylesheet. Die Standardwerte hier und in
* App\Domain\Design\DesignScale müssen gleich sein (Test DesignScaleTest). Ableitungsregeln stehen nur hier.
* Umgerechnet wird in rem, damit die Textgröße des Browsers wirkt. Trefferflächen (--touch-target) und die
* Untergrenze 16 px für Fließtext sind nicht einstellbar.
*/
--ds-body: 17;
--ds-h1: 40;
--ds-h2: 28;
--ds-display: 52;
--ds-space: 8;
--ds-section: 48;
--ds-card-pad: 20;
--ds-header: 80;
--ds-width: 1312;
--ds-media: 320;
/*
* Fließende Interpolation: --fl ist 0 bei 22,5 rem (360 px) Fensterbreite und 1 rem bei 75 rem (1200 px). Ein Wert
* zwischen Minimum und Maximum (Zahlen in px) lautet clamp(min, min + (max − min) / 16 × --fl, max).
*/
--fl: calc((100vw - 22.5rem) / 52.5);
/* Typografie. Minimum auf kleinen Bildschirmen, Maximum ab 75 rem. Überschriften bleiben stets größer als der Text. */
--font-reading: var(--font-sans);
--text-small: 0.9375rem;
--text-body: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem);
--text-lede: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
--text-h3: clamp(1.25rem, 1.16rem + 0.4vw, 1.375rem);
--text-h2: clamp(1.625rem, 1.35rem + 1.2vw, 2.125rem);
--text-h1: clamp(2.125rem, 1.6rem + 2.4vw, 3.25rem);
--leading-body: 1.6;
--n-body-min: max(16, calc(var(--ds-body) - 1));
--n-h3-max: min(calc(var(--ds-body) * 1.18), calc(var(--ds-h2) * 0.8));
--n-h3-min: min(calc(var(--ds-body) * 1.06), var(--n-h3-max));
--n-h2-min: max(calc(var(--n-body-min) * 1.15), calc(var(--ds-h2) * 0.79));
--n-h1-min: max(calc(var(--n-h2-min) * 1.15), calc(var(--ds-h1) * 0.7));
--n-display-min: max(calc(var(--n-h1-min) * 1.1), calc(var(--ds-display) * 0.62));
--text-body: clamp(calc(var(--n-body-min) / 16 * 1rem), calc(var(--n-body-min) / 16 * 1rem + (var(--ds-body) - var(--n-body-min)) / 16 * var(--fl)), calc(var(--ds-body) / 16 * 1rem));
--text-small: max(0.875rem, calc(var(--ds-body) * 0.85 / 16 * 1rem));
--text-button: max(0.9375rem, calc(var(--ds-body) * 0.88 / 16 * 1rem));
--text-lede: clamp(calc(var(--n-body-min) * 1.06 / 16 * 1rem), calc(var(--n-body-min) * 1.06 / 16 * 1rem + (var(--ds-body) * 1.12 - var(--n-body-min) * 1.06) / 16 * var(--fl)), calc(var(--ds-body) * 1.12 / 16 * 1rem));
--text-h3: clamp(calc(var(--n-h3-min) / 16 * 1rem), calc(var(--n-h3-min) / 16 * 1rem + (var(--n-h3-max) - var(--n-h3-min)) / 16 * var(--fl)), calc(var(--n-h3-max) / 16 * 1rem));
--text-h2: clamp(calc(var(--n-h2-min) / 16 * 1rem), calc(var(--n-h2-min) / 16 * 1rem + (var(--ds-h2) - var(--n-h2-min)) / 16 * var(--fl)), calc(var(--ds-h2) / 16 * 1rem));
--text-h1: clamp(calc(var(--n-h1-min) / 16 * 1rem), calc(var(--n-h1-min) / 16 * 1rem + (var(--ds-h1) - var(--n-h1-min)) / 16 * var(--fl)), calc(var(--ds-h1) / 16 * 1rem));
--text-display: clamp(calc(var(--n-display-min) / 16 * 1rem), calc(var(--n-display-min) / 16 * 1rem + (var(--ds-display) - var(--n-display-min)) / 16 * var(--fl)), calc(var(--ds-display) / 16 * 1rem));
--leading-body: 1.55;
--leading-heading: 1.15;
--measure: 70ch;
/* Abstände (Grundmaß 4 px) */
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.5rem;
--space-6: 2rem;
--space-7: 3rem;
--space-8: 4rem;
--space-9: 6rem;
/* Abstände: Vielfache des Basisabstands (bei 8 px: 4, 8, 12, 16, 24, 32, 48, 64, 96 px) */
--space-1: calc(var(--ds-space) * 0.5 / 16 * 1rem);
--space-2: calc(var(--ds-space) / 16 * 1rem);
--space-3: calc(var(--ds-space) * 1.5 / 16 * 1rem);
--space-4: calc(var(--ds-space) * 2 / 16 * 1rem);
--space-5: calc(var(--ds-space) * 3 / 16 * 1rem);
--space-6: calc(var(--ds-space) * 4 / 16 * 1rem);
--space-7: calc(var(--ds-space) * 6 / 16 * 1rem);
--space-8: calc(var(--ds-space) * 8 / 16 * 1rem);
--space-9: calc(var(--ds-space) * 12 / 16 * 1rem);
/*
* Innenabstände von Flächen. --pad-card: Karten (kleine Bildschirme 80 %). --pad-surface: Obergrenze für große
* Flächen (Einstieg, Bild und Text, Handlungsaufruf); diese wachsen mit dem Platz (cqi) zwischen beiden Werten.
*/
--pad-card: clamp(calc(var(--ds-card-pad) * 0.8 / 16 * 1rem), calc(var(--ds-card-pad) * 0.8 / 16 * 1rem + var(--ds-card-pad) * 0.2 / 16 * var(--fl)), calc(var(--ds-card-pad) / 16 * 1rem));
--pad-surface: calc(var(--ds-card-pad) * 2.4 / 16 * 1rem);
/* Rundungen und Schatten */
--radius-small: 8px;
@@ -116,20 +156,31 @@ :root {
* - Vollbreite: Inhalt bis an den Seitenrand (mit Randabstand)
*/
--gutter: clamp(1rem, 4vw, 2.5rem);
--grid-gap: clamp(1.25rem, 2.5vw, 2.25rem);
/* Stufen der Abschnittsabstände (oben, unten) und des Widget-Abstands im Abschnittsraster (SectionStyle::SPACINGS). */
/*
* Stufen der Abschnittsabstände (oben, unten) und des Widget-Abstands im Abschnittsraster (SectionStyle::SPACINGS),
* abgeleitet aus --ds-section (Normal auf Desktop; Kompakt zwei Drittel, Großzügig das Anderthalbfache) und
* --ds-space. Auf kleinen Bildschirmen jeweils kleiner.
*/
--section-space-none: 0px;
--section-space-compact: clamp(1.5rem, 1rem + 2vw, 3rem);
--section-space-normal: clamp(3rem, 2rem + 4vw, 6rem);
--section-space-large: clamp(4.5rem, 3rem + 5vw, 8rem);
--section-space-compact: clamp(calc(var(--ds-section) * 0.5 / 16 * 1rem), calc(var(--ds-section) * 0.5 / 16 * 1rem + var(--ds-section) * 0.1667 / 16 * var(--fl)), calc(var(--ds-section) * 0.6667 / 16 * 1rem));
--section-space-normal: clamp(calc(var(--ds-section) * 0.75 / 16 * 1rem), calc(var(--ds-section) * 0.75 / 16 * 1rem + var(--ds-section) * 0.25 / 16 * var(--fl)), calc(var(--ds-section) / 16 * 1rem));
--section-space-large: clamp(calc(var(--ds-section) / 16 * 1rem), calc(var(--ds-section) / 16 * 1rem + var(--ds-section) * 0.5 / 16 * var(--fl)), calc(var(--ds-section) * 1.5 / 16 * 1rem));
--section-gap-none: 0px;
--section-gap-compact: clamp(0.75rem, 1.25vw, 1.25rem);
--section-gap-normal: clamp(1.25rem, 2.5vw, 2.25rem);
--section-gap-large: clamp(2rem, 4vw, 3.5rem);
--section-gap-compact: clamp(calc(var(--ds-space) * 1.5 / 16 * 1rem), calc(var(--ds-space) * 1.5 / 16 * 1rem + var(--ds-space) * 0.5 / 16 * var(--fl)), calc(var(--ds-space) * 2 / 16 * 1rem));
--section-gap-normal: clamp(calc(var(--ds-space) * 2 / 16 * 1rem), calc(var(--ds-space) * 2 / 16 * 1rem + var(--ds-space) * 1.5 / 16 * var(--fl)), calc(var(--ds-space) * 3.5 / 16 * 1rem));
--section-gap-large: clamp(calc(var(--ds-space) * 3 / 16 * 1rem), calc(var(--ds-space) * 3 / 16 * 1rem + var(--ds-space) * 2 / 16 * var(--fl)), calc(var(--ds-space) * 5 / 16 * 1rem));
--grid-gap: var(--section-gap-normal);
--width-reading: 44rem;
--width-standard: 82rem;
--width-wide: 96rem;
--width-standard: calc(var(--ds-width) / 16 * 1rem);
--width-wide: calc(var(--ds-width) * 1.17 / 16 * 1rem);
/*
* Mediengröße. --media-h: Höhe des Bildes neben dem Text (Bild und Text, Variante Standard). Die Dichtestufen der
* Größenvarianten (Einstieg: kompakt, normal, groß; Bild und Text: kompakt, normal, großzügig) skalieren über
* --dens (Kompakt 0,75, Standard 1, Großzügig 1,3) Bildhöhe, Mindesthöhe und Innenabstände.
*/
--media-h: calc(var(--ds-media) / 16 * 1rem);
--container-narrow: var(--width-reading);
--container-standard: var(--width-standard);
--container-wide: var(--width-wide);
@@ -141,18 +192,33 @@ :root {
* --header-height-initial hoch und klebt mit negativem Abstand, sodass beim Scrollen nur die
* kompakte Leiste (--header-height) sichtbar bleibt. Auf Smartphones sind beide Werte gleich.
*/
--header-height: 4rem;
--header-height-initial: 4rem;
--header-height: calc(var(--ds-header) * 0.8 / 16 * 1rem);
--header-height-initial: calc(var(--ds-header) * 0.8 / 16 * 1rem);
--touch-target: 2.75rem;
}
@media (min-width: 75rem) {
:root {
--header-height: 4.5rem;
--header-height-initial: 6.5rem;
--header-height-initial: calc(var(--ds-header) / 16 * 1rem);
}
}
/* Dichtestufen der Größenvarianten (gespeicherte Schlüssel bleiben compact, normal, large bzw. spacious). */
.lf-hero,
.lf-bt {
--dens: 1;
}
.lf-hero--height-compact,
.lf-bt--height-compact {
--dens: 0.75;
}
.lf-hero--height-large,
.lf-bt--height-spacious {
--dens: 1.3;
}
/* Dunkle Fläche: helle Schrift, gelber Fokus (Navy/Weiß 15:1). */
.scope-dark {
--color-text: #f4f6f8;