Checkbox, Radio und Schalter (v2.0)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -18,4 +18,4 @@ The guide is meant to be the shared design foundation for all of the owner's app
|
|||||||
- Color tokens (section 3) are the single source of truth for hex values, mirrored in `tokens.css` (dark = fallback, light via `prefers-color-scheme` and `data-theme`). Change both together. `theme.js` is the reference theme switcher that sets `data-theme`. Contrast ratios in section 4 are computed from the opaque token values, so recompute them if any color token changes.
|
- Color tokens (section 3) are the single source of truth for hex values, mirrored in `tokens.css` (dark = fallback, light via `prefers-color-scheme` and `data-theme`). Change both together. `theme.js` is the reference theme switcher that sets `data-theme`. Contrast ratios in section 4 are computed from the opaque token values, so recompute them if any color token changes.
|
||||||
- Styles (section 3, "Stile") only override accent tokens (`data-accent` in `tokens.css`); a new style needs the same contrast checks as Orange/Blue. The z-index, dialog, toast and sortable-list values originate from the owner's Studio app (`../Golden-Age-Wiki/studio/src/app.css`).
|
- Styles (section 3, "Stile") only override accent tokens (`data-accent` in `tokens.css`); a new style needs the same contrast checks as Orange/Blue. The z-index, dialog, toast and sortable-list values originate from the owner's Studio app (`../Golden-Age-Wiki/studio/src/app.css`).
|
||||||
- `reference.html` renders every token and component from `tokens.css`/`theme.js`; update it when tokens or components change, and check it in dark/light and both styles (headless: `chromium --headless --screenshot --blink-settings=preferredColorScheme=0|1`).
|
- `reference.html` renders every token and component from `tokens.css`/`theme.js`; update it when tokens or components change, and check it in dark/light and both styles (headless: `chromium --headless --screenshot --blink-settings=preferredColorScheme=0|1`).
|
||||||
- Version and date are in the header line ("Version 1.9 · Stand: 16.11.2026"; the README status line repeats the version); update it when making substantive changes.
|
- Version and date are in the header line ("Version 2.0 · Stand: 16.11.2026"; the README status line repeats the version); update it when making substantive changes.
|
||||||
|
|||||||
@ -10,7 +10,7 @@ Die Ausgangswerte stammen aus der Oberfläche von Nexus 0.1.7, die sich an llm-a
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
Version 1.9 (Stand 16.11.2026). Der Guide enthält Farb-Tokens für ein dunkles und ein helles Theme, zwei Akzent-Stile (Orange, Blau), Typografie, Abstände, Radien, Komponenten, Responsive-Regeln und eine Prüfliste zur Barrierefreiheit.
|
Version 2.0 (Stand 16.11.2026). Der Guide enthält Farb-Tokens für ein dunkles und ein helles Theme, zwei Akzent-Stile (Orange, Blau), Typografie, Abstände, Radien, Komponenten, Responsive-Regeln und eine Prüfliste zur Barrierefreiheit.
|
||||||
|
|
||||||
Bisher ist er nur aus Nexus abgeleitet. Die als *Empfehlung* markierten Regeln sind in weiteren Apps oder Websites noch nicht praktisch abgenommen.
|
Bisher ist er nur aus Nexus abgeleitet. Die als *Empfehlung* markierten Regeln sind in weiteren Apps oder Websites noch nicht praktisch abgenommen.
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Bisher ist er nur aus Nexus abgeleitet. Die als *Empfehlung* markierten Regeln s
|
|||||||
| **Farben und Themes** | Semantische Tokens für Dunkel und Hell, Stile (Orange, Blau), Kontrastwerte |
|
| **Farben und Themes** | Semantische Tokens für Dunkel und Hell, Stile (Orange, Blau), Kontrastwerte |
|
||||||
| **Typografie** | Schriftliste mit Fallbacks, Größen, Zeilenhöhen |
|
| **Typografie** | Schriftliste mit Fallbacks, Größen, Zeilenhöhen |
|
||||||
| **Layout und Formen** | Abstände, Container, Radien, Rahmen, Schatten |
|
| **Layout und Formen** | Abstände, Container, Radien, Rahmen, Schatten |
|
||||||
| **Komponenten** | Buttons, Formulare, Tabs, Aufklappmenü, Ebenen/Dialoge, Sortierlisten, Karten, Status, Tabellen, Fortschritt, Chat |
|
| **Komponenten** | Buttons, Formulare, Auswahlfelder, Tabs, Aufklappmenü, Ebenen/Dialoge, Sortierlisten, Karten, Status, Tabellen, Fortschritt, Chat |
|
||||||
| **Responsive, Bewegung, Sprache** | Breakpoint-Ausgangswert, Rückmeldung, Ton und Beispieltexte |
|
| **Responsive, Bewegung, Sprache** | Breakpoint-Ausgangswert, Rückmeldung, Ton und Beispieltexte |
|
||||||
| **Barrierefreiheit und Pflege** | Prüfliste je Produkt, Hinweise zur Einführung |
|
| **Barrierefreiheit und Pflege** | Prüfliste je Produkt, Hinweise zur Einführung |
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Styleguide für Apps und Websites
|
# Styleguide für Apps und Websites
|
||||||
|
|
||||||
Version 1.9 · Stand: 16.11.2026 · Wiederverwendbare Gestaltungsgrundlage
|
Version 2.0 · Stand: 16.11.2026 · Wiederverwendbare Gestaltungsgrundlage
|
||||||
|
|
||||||
Dieser Guide beschreibt eine gemeinsame visuelle Sprache für Apps, Webanwendungen und Websites: ruhige Flächen, klare Typografie, abgerundete Komponenten und Orange als wiederkehrende Akzentfarbe. Grundlage ist das bereits in Nexus verwendete, an llm-arena orientierte Design. Inhalte, Navigation und Markenname passen sich dem jeweiligen Produkt an.
|
Dieser Guide beschreibt eine gemeinsame visuelle Sprache für Apps, Webanwendungen und Websites: ruhige Flächen, klare Typografie, abgerundete Komponenten und Orange als wiederkehrende Akzentfarbe. Grundlage ist das bereits in Nexus verwendete, an llm-arena orientierte Design. Inhalte, Navigation und Markenname passen sich dem jeweiligen Produkt an.
|
||||||
|
|
||||||
@ -273,6 +273,33 @@ Felder verwenden eine neutrale Fläche, einen dünnen Rahmen in `--border-field`
|
|||||||
|
|
||||||
**Empfehlung:** Jedes Feld erhält eine dauerhafte Beschriftung. Platzhalter ersetzen keine Labels. Fehler werden am betroffenen Feld erklärt. Formulare bleiben bei kleinen Fenstern und Textvergrößerung bedienbar. Pflichtangaben und Auswirkungen einer Aktion sind vor dem Absenden verständlich.
|
**Empfehlung:** Jedes Feld erhält eine dauerhafte Beschriftung. Platzhalter ersetzen keine Labels. Fehler werden am betroffenen Feld erklärt. Formulare bleiben bei kleinen Fenstern und Textvergrößerung bedienbar. Pflichtangaben und Auswirkungen einer Aktion sind vor dem Absenden verständlich.
|
||||||
|
|
||||||
|
### Auswahlfelder: Checkbox, Radio und Schalter
|
||||||
|
|
||||||
|
| Element | Verwendung |
|
||||||
|
| --- | --- |
|
||||||
|
| Checkbox | Eine oder mehrere unabhängige Optionen; wirkt beim Absenden des Formulars |
|
||||||
|
| Radio | Genau eine Option aus einer kleinen, sichtbaren Gruppe (bis etwa fünf Optionen; darüber das native Auswahlfeld) |
|
||||||
|
| Schalter | Eine Einstellung, die sofort wirkt (an/aus) |
|
||||||
|
|
||||||
|
Gemeinsame Werte (`tokens.css`):
|
||||||
|
|
||||||
|
| Eigenschaft | Wert |
|
||||||
|
| --- | --- |
|
||||||
|
| Größe | `--control-size` (1,15 rem) für Checkbox und Radio; Schalter `--switch-width` × `--switch-height` (2,3 × 1,3 rem) |
|
||||||
|
| Form | Checkbox 4 px Radius, Radio und Schalter vollständig rund |
|
||||||
|
| Rahmen | 1,5 px `--border-field` (mindestens 3:1) |
|
||||||
|
| Fläche aus | `--surface` (Schalter: `--surface-2`) |
|
||||||
|
| Fläche an | `--accent-strong`; Haken, Punkt und Schalterknopf in `--accent-text` |
|
||||||
|
| Knopf des Schalters aus | `--muted` |
|
||||||
|
| Deaktiviert | Deckkraft 0,5, nicht auslösbar |
|
||||||
|
| Fehler | Rahmen `--danger`, Meldung darunter |
|
||||||
|
| Fokus | Fokusring aus Abschnitt 4 direkt am Element |
|
||||||
|
| Klickfläche | Die ganze Beschriftung löst aus; die Zeile ist mindestens `--target-min` (24 px) hoch |
|
||||||
|
|
||||||
|
Der Zustand ist nicht allein an der Farbe erkennbar: Die Checkbox zeigt einen Haken (unklar: einen Strich), das Radio einen Punkt, der Schalter verschiebt den Knopf. Jedes Element hat eine sichtbare Beschriftung, die Gruppe zusammengehöriger Optionen eine gemeinsame Überschrift (`fieldset` mit `legend`).
|
||||||
|
|
||||||
|
**Empfehlung:** Schalter tragen `role="switch"` (auf einer Checkbox). Ihre Beschriftung beschreibt die Einstellung, nicht die Handlung („Automatisch speichern“, nicht „Umschalten“). Ein Schalter, dessen Wirkung nicht sofort eintritt oder ein Absenden braucht, ist eine Checkbox. Optionen, die sich auf andere auswirken, werden nach dem Umschalten sichtbar.
|
||||||
|
|
||||||
### Ebenen, Dialoge und Hinweise
|
### Ebenen, Dialoge und Hinweise
|
||||||
|
|
||||||
Überlagerungen verwenden feste Ebenen statt frei gewählter `z-index`-Werte (Ausgangswerte aus Studio):
|
Überlagerungen verwenden feste Ebenen statt frei gewählter `z-index`-Werte (Ausgangswerte aus Studio):
|
||||||
|
|||||||
@ -104,6 +104,24 @@
|
|||||||
|
|
||||||
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
|
progress { width: 100%; height: .6rem; accent-color: var(--accent-strong); }
|
||||||
|
|
||||||
|
.choice { font-weight: 400; font-size: 1rem; margin-bottom: 0; display: inline-flex; align-items: center; gap: .55rem; min-height: var(--target-min); cursor: pointer; }
|
||||||
|
.choice input { appearance: none; -webkit-appearance: none; margin: 0; flex: none; position: relative; cursor: pointer;
|
||||||
|
width: var(--control-size); height: var(--control-size); background: var(--surface); border: 1.5px solid var(--border-field); transition: background var(--transition), border-color var(--transition); }
|
||||||
|
.choice input[type="checkbox"] { border-radius: 4px; }
|
||||||
|
.choice input[type="radio"] { border-radius: 50%; }
|
||||||
|
.choice input:checked, .choice input[type="checkbox"]:indeterminate { background: var(--accent-strong); border-color: var(--accent-strong); }
|
||||||
|
.choice input[type="checkbox"]:not([role="switch"]):checked::after { content: ""; position: absolute; left: 32%; top: 12%; width: 28%; height: 52%; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
|
||||||
|
.choice input[type="checkbox"]:indeterminate::after { content: ""; position: absolute; left: 22%; right: 22%; top: calc(50% - 1px); height: 2px; background: var(--accent-text); }
|
||||||
|
.choice input[type="radio"]:checked::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: var(--accent-text); }
|
||||||
|
.choice input[role="switch"] { width: var(--switch-width); height: var(--switch-height); border-radius: var(--radius-pill); background: var(--surface-2); }
|
||||||
|
.choice input[role="switch"]::after { content: ""; position: absolute; top: 50%; left: 3px; width: calc(var(--switch-height) - 10px); height: calc(var(--switch-height) - 10px); border-radius: 50%; background: var(--muted); transform: translateY(-50%); transition: left var(--transition), background var(--transition); }
|
||||||
|
.choice input[role="switch"]:checked { background: var(--accent-strong); }
|
||||||
|
.choice input[role="switch"]:checked::after { left: calc(100% - (var(--switch-height) - 10px) - 3px); background: var(--accent-text); }
|
||||||
|
.choice input.invalid { border-color: var(--danger); }
|
||||||
|
.choice:has(input:disabled) { opacity: .5; cursor: not-allowed; }
|
||||||
|
.choice input:disabled { cursor: not-allowed; }
|
||||||
|
fieldset { border: 0; margin: 0; padding: 0; }
|
||||||
|
legend { font-size: var(--font-size-small); font-weight: 600; padding: 0; margin-bottom: .25rem; }
|
||||||
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
|
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
|
||||||
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
|
.tabs button { font: inherit; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 12px; color: var(--muted); cursor: pointer; }
|
||||||
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
|
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent-strong); font-weight: 600; }
|
||||||
@ -234,6 +252,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section class="card">
|
||||||
|
<h2>Checkbox, Radio und Schalter</h2>
|
||||||
|
<div class="formgrid">
|
||||||
|
<fieldset><legend>Optionen</legend>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" checked> Benachrichtigungen</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox"> Newsletter</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" id="ind"> Teilweise gewählt</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" disabled> Nicht verfügbar</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" class="invalid" aria-describedby="e-ok"> Bedingungen akzeptieren</label>
|
||||||
|
<div class="err" id="e-ok">Bitte bestätige die Bedingungen.</div>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset><legend>Ansicht</legend>
|
||||||
|
<label class="choice" style="display:flex"><input type="radio" name="v" checked> Liste</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="radio" name="v"> Raster</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="radio" name="v" disabled> Karte (nicht verfügbar)</label>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset><legend>Einstellungen</legend>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" role="switch" checked> Automatisch speichern</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" role="switch"> Kompakte Ansicht</label>
|
||||||
|
<label class="choice" style="display:flex"><input type="checkbox" role="switch" disabled> Nicht verfügbar</label>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="card">
|
<section class="card">
|
||||||
<h2>Kennzahlen und Fortschritt</h2>
|
<h2>Kennzahlen und Fortschritt</h2>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
@ -319,6 +361,7 @@
|
|||||||
setAccent(acc);
|
setAccent(acc);
|
||||||
seg("accent-seg", acc, setAccent);
|
seg("accent-seg", acc, setAccent);
|
||||||
|
|
||||||
|
document.getElementById("ind").indeterminate = true;
|
||||||
var tabs = Array.prototype.slice.call(document.querySelectorAll("#tabs [role=tab]"));
|
var tabs = Array.prototype.slice.call(document.querySelectorAll("#tabs [role=tab]"));
|
||||||
function selectTab(i, focus) {
|
function selectTab(i, focus) {
|
||||||
tabs.forEach(function (b, j) {
|
tabs.forEach(function (b, j) {
|
||||||
|
|||||||
@ -138,6 +138,11 @@
|
|||||||
--breakpoint-compact: 40rem; /* nur zur Dokumentation; in @media als Literal verwenden */
|
--breakpoint-compact: 40rem; /* nur zur Dokumentation; in @media als Literal verwenden */
|
||||||
--transition: 0.12s;
|
--transition: 0.12s;
|
||||||
|
|
||||||
|
--control-size: 1.15rem;
|
||||||
|
--switch-width: 2.3rem;
|
||||||
|
--switch-height: 1.3rem;
|
||||||
|
--target-min: 24px;
|
||||||
|
|
||||||
--backdrop: rgba(0, 0, 0, .5);
|
--backdrop: rgba(0, 0, 0, .5);
|
||||||
--dialog-width: 560px;
|
--dialog-width: 560px;
|
||||||
--dialog-pad: 18px 22px;
|
--dialog-pad: 18px 22px;
|
||||||
|
|||||||
Reference in New Issue
Block a user