Skip to content

Commit fa1391a

Browse files
committed
fix(tokens): unify status -subtle alpha to 0.12; drop dev-notes from manual
- core/tokens.css: --sf-color-info-subtle and --sf-color-danger-subtle were 0.10 alpha while success/warning were 0.12, so danger/info alert backgrounds rendered slightly fainter than success/warning at the same content. Unify all four status -subtle washes to 0.12 (the finding documented while writing the colour manual). Regenerated value-bearing docs. - user-manual/system-kolorow.md: remove the "Znalezione nieścisłości we frameworku" section (§9) — maintainer-facing findings don't belong in a user manual (PR #627 review); renumber the cheatsheet §10 → §9. Also refresh one stale §8 rationale ("ramp computed for a specific background") to the new solid-colour-doesn't-blend wording. - CHANGELOG: note the status -subtle alpha fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012X2fkd5DbmNJywKcNy6NjF
1 parent 4e363f3 commit fa1391a

10 files changed

Lines changed: 20 additions & 64 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
77
## [0.7.19] - 2026-07-16
88

99
### Bug Fixes
10+
- **tokens:** `--sf-color-info-subtle` and `--sf-color-danger-subtle` were `0.10` alpha while `--sf-color-success-subtle` / `--sf-color-warning-subtle` were `0.12`, so a `danger`/`info` alert-box background rendered slightly fainter than a `success`/`warning` one at the same content. Unified all four status `-subtle` washes to `0.12` (the `-muted` `0.3` and `-tint` `0.05` rungs were already consistent).
1011
- **tokens:** the numeric brand ramps (`--sf-color-{primary,secondary,tertiary,action,neutral}-50…950`) no longer fold into a "U". The previous model generated each step with `color-mix()` toward the theme's `--sf-color-surface` (tints) / `--sf-color-text` (shades) — so when a chosen source colour fell outside the band between those two anchors (e.g. a brand darker than the text colour, or a project that lightened `--sf-color-neutral`), the shade half inverted and climbed back up: steps 600–950 came out *lighter* than 500, and 50 ≈ 950. The ramp is now generated in OKLCH by pulling the family colour's own lightness a fixed fraction toward an **absolute** target — `--sf-palette-tint-l` (tints) / `--sf-palette-shade-l` (shades) — clamped with `max()`/`min()` so a tint can never end darker than the base nor a shade lighter. The ladder is therefore monotonic light→dark for **any** source colour and any anchor configuration. Chroma is tapered toward the extremes to avoid oversaturation. For default-palette colours (which already sat inside the safe band) the output is visually unchanged; only out-of-band / moved-anchor cases are corrected. `base` is unchanged (it already used absolute lightness steps). New parametric test `tests/ramp-monotonic.spec.js` sweeps the lightness axis for all five families and asserts the ramp never folds and no step is transparent.
1112
- **configurator:** the Colors panel's "Palette ramp" section now edits the two lightness anchors (`--sf-palette-tint-l` / `--sf-palette-shade-l`) with two `0–1` sliders instead of the ten removed `--sf-palette-mix-*` percentage sliders; the Softer/Default/Punchy presets and the live palette preview were rewired to the absolute-anchor model so the preview matches the framework and stays monotonic.
1213
- **layout:** `@container` breakpoints for `.sf-grid-cols-*`, `.sf-bento` and `.sf-alternate` now use `rem` instead of `em`. Inside a container query an `em` resolves against the query container's own font-size, which under the default fluid type scale is inherited from `body` (a `clamp()` over `100vw`, ~16–20px) — so the same fixed-width container rendered a different column count depending on the *viewport*: an 800px container showed `.sf-grid-cols-3` as 3 columns at a 500px viewport but 1 column at 1200px+. `rem` resolves against the fixed root (`html` stays 16px; fluid type is applied to `body`), restoring the documented "responds to its own container width, not the viewport" contract. Thresholds are unchanged numerically (30rem = 480px, 48rem = 768px) and still honour user zoom / root-font-size. Also corrects `docs/architecture.md`, which wrongly listed `.sf-grid` / `.sf-sidebar` as `@container` primitives (both are intrinsic and carry no container query).

configurator/src/data/api-index.generated.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"_sync": {
33
"generatedBy": "configurator/scripts/sync-api.mjs",
44
"source": "docs/api-index.json",
5-
"tokensHash": "5c5b69ba4fa3",
5+
"tokensHash": "fb3441987ce7",
66
"bundles": [
77
"full",
88
"optimal"
@@ -3727,7 +3727,7 @@
37273727
"group": "Status triplets",
37283728
"description": "Three-shade status triplets (subtle / muted / strong) for each status role. Use subtle for backgrounds, muted for fills, strong for text on light surfaces.",
37293729
"note": "Light danger tint for error row backgrounds and alert container fills.",
3730-
"value": "oklch(from var(--sf-color-danger) l c h / 0.1)",
3730+
"value": "oklch(from var(--sf-color-danger) l c h / 0.12)",
37313731
"aliasOf": null,
37323732
"registered": false,
37333733
"syntax": null,
@@ -3916,7 +3916,7 @@
39163916
"group": "Status triplets",
39173917
"description": "Three-shade status triplets (subtle / muted / strong) for each status role. Use subtle for backgrounds, muted for fills, strong for text on light surfaces.",
39183918
"note": "Light info tint for informational note backgrounds.",
3919-
"value": "oklch(from var(--sf-color-info) l c h / 0.1)",
3919+
"value": "oklch(from var(--sf-color-info) l c h / 0.12)",
39203920
"aliasOf": null,
39213921
"registered": false,
39223922
"syntax": null,

core/tokens.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@
608608
--sf-color-warning-muted: oklch(from var(--sf-color-warning) l c h / 0.3);
609609
--sf-color-warning-tint: oklch(from var(--sf-color-warning) l c h / 0.05);
610610

611-
--sf-color-info-subtle: oklch(from var(--sf-color-info) l c h / 0.1);
611+
--sf-color-info-subtle: oklch(from var(--sf-color-info) l c h / 0.12);
612612
--sf-color-info-muted: oklch(from var(--sf-color-info) l c h / 0.3);
613613
--sf-color-info-tint: oklch(from var(--sf-color-info) l c h / 0.05);
614614

615-
--sf-color-danger-subtle: oklch(from var(--sf-color-danger) l c h / 0.1);
615+
--sf-color-danger-subtle: oklch(from var(--sf-color-danger) l c h / 0.12);
616616
--sf-color-danger-muted: oklch(from var(--sf-color-danger) l c h / 0.3);
617617
--sf-color-danger-tint: oklch(from var(--sf-color-danger) l c h / 0.05);
618618

dist/css-custom-data.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@
893893
},
894894
{
895895
"name": "--sf-color-danger-subtle",
896-
"description": "Light danger tint for error row backgrounds and alert container fills.\n\nDefault: `oklch(from var(--sf-color-danger) l c h / 0.1)`",
896+
"description": "Light danger tint for error row backgrounds and alert container fills.\n\nDefault: `oklch(from var(--sf-color-danger) l c h / 0.12)`",
897897
"syntax": "*"
898898
},
899899
{
@@ -938,7 +938,7 @@
938938
},
939939
{
940940
"name": "--sf-color-info-subtle",
941-
"description": "Light info tint for informational note backgrounds.\n\nDefault: `oklch(from var(--sf-color-info) l c h / 0.1)`",
941+
"description": "Light info tint for informational note backgrounds.\n\nDefault: `oklch(from var(--sf-color-info) l c h / 0.12)`",
942942
"syntax": "*"
943943
},
944944
{

docs/api-index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4684,7 +4684,7 @@
46844684
"area": "core",
46854685
"group": "Status triplets",
46864686
"description": "Light danger tint for error row backgrounds and alert container fills.",
4687-
"value": "oklch(from var(--sf-color-danger) l c h / 0.1)",
4687+
"value": "oklch(from var(--sf-color-danger) l c h / 0.12)",
46884688
"aliasOf": null,
46894689
"registered": false,
46904690
"animatable": false,
@@ -4918,7 +4918,7 @@
49184918
"area": "core",
49194919
"group": "Status triplets",
49204920
"description": "Light info tint for informational note backgrounds.",
4921-
"value": "oklch(from var(--sf-color-info) l c h / 0.1)",
4921+
"value": "oklch(from var(--sf-color-info) l c h / 0.12)",
49224922
"aliasOf": null,
49234923
"registered": false,
49244924
"animatable": false,

docs/api-index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ and a short description. The machine-readable companion (with all columns) is
188188
| `--sf-color-danger-source-dark` | PUBLIC | knob | color | `oklch(0.71 0.198 12)` | Registered <color> dark counterpart of --sf-color-danger. |
189189
| `--sf-color-danger-source-light` | PUBLIC | knob | color | `oklch(0.48 0.22 12)` | OKLCH lightness source for the danger status color (covers destructive actions and form validation errors). |
190190
| `--sf-color-danger-strong` | PUBLIC | consumption | color | `light-dark( oklch(from var(--sf-color-danger-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-danger) clamp(0.70, calc(l + 0.15), 1) c h) )` | High-contrast danger color for alert body text and icons. |
191-
| `--sf-color-danger-subtle` | PUBLIC | consumption | color | `oklch(from var(--sf-color-danger) l c h / 0.1)` | Light danger tint for error row backgrounds and alert container fills. |
191+
| `--sf-color-danger-subtle` | PUBLIC | consumption | color | `oklch(from var(--sf-color-danger) l c h / 0.12)` | Light danger tint for error row backgrounds and alert container fills. |
192192
| `--sf-color-danger-tint` | PUBLIC | consumption | color | `oklch(from var(--sf-color-danger) l c h / 0.05)` | Near-transparent danger tint (5% alpha) for hover-state washes and the most subtle backgrounds. |
193193
| `--sf-color-dim` | PUBLIC | knob | color | `oklch(0 0 0 / 0.5)` | Backdrop overlay color for modals, drawers, and lightboxes. |
194194
| `--sf-color-heading` | PUBLIC | consumption | color | `light-dark( oklch(from var(--sf-color-neutral-source-light) clamp(0.05, calc(l - 0.4 - var(--sf-contrast-bias)), 0.35) c h), oklch(from var(--sf-color-neutral) clamp(0.70, calc(l + 0.25 + var(--sf-contrast-bias)), 1) c h) )` | Heading text color. Slightly stronger contrast than body text for visual hierarchy. |
@@ -197,7 +197,7 @@ and a short description. The machine-readable companion (with all columns) is
197197
| `--sf-color-info-source-dark` | PUBLIC | knob | color | `oklch(0.71 0.162 235)` | Registered <color> dark counterpart of --sf-color-info. |
198198
| `--sf-color-info-source-light` | PUBLIC | knob | color | `oklch(0.48 0.18 235)` | OKLCH lightness source for the info status color. |
199199
| `--sf-color-info-strong` | PUBLIC | consumption | color | `light-dark( oklch(from var(--sf-color-info-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-info) clamp(0.70, calc(l + 0.15), 1) c h) )` | High-contrast info color for hint body text. |
200-
| `--sf-color-info-subtle` | PUBLIC | consumption | color | `oklch(from var(--sf-color-info) l c h / 0.1)` | Light info tint for informational note backgrounds. |
200+
| `--sf-color-info-subtle` | PUBLIC | consumption | color | `oklch(from var(--sf-color-info) l c h / 0.12)` | Light info tint for informational note backgrounds. |
201201
| `--sf-color-info-tint` | PUBLIC | consumption | color | `oklch(from var(--sf-color-info) l c h / 0.05)` | Near-transparent info tint (5% alpha) for hover-state washes and the most subtle backgrounds. |
202202
| `--sf-color-inset` | PUBLIC | consumption | color | `oklch(from var(--sf-color-base) calc(l - 0.02) c h)` | Slightly inset surface for nested areas — inputs, code blocks, sidebar panels. |
203203
| `--sf-color-inverse` | PUBLIC | consumption | color | `oklch(from var(--sf-color-base) calc(1 - l) c h)` | Inverted (dark-on-light / light-on-dark) surface for high-contrast banners or tooltips. |

docs/token-index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@
14511451
"files": [
14521452
"core/tokens.css"
14531453
],
1454-
"value": "oklch(from var(--sf-color-danger) l c h / 0.1)"
1454+
"value": "oklch(from var(--sf-color-danger) l c h / 0.12)"
14551455
},
14561456
"--sf-color-danger-tint": {
14571457
"tier": "PUBLIC",
@@ -1523,7 +1523,7 @@
15231523
"files": [
15241524
"core/tokens.css"
15251525
],
1526-
"value": "oklch(from var(--sf-color-info) l c h / 0.1)"
1526+
"value": "oklch(from var(--sf-color-info) l c h / 0.12)"
15271527
},
15281528
"--sf-color-info-tint": {
15291529
"tier": "PUBLIC",

docs/token-index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ declared value (a value that references `var(--sf-…)` is a derived output):
266266
| `--sf-color-danger-source-dark` | PUBLIC | knob | Core | `oklch(0.71 0.198 12) (registered)` |
267267
| `--sf-color-danger-source-light` | PUBLIC | knob | Core | `oklch(0.48 0.22 12)` |
268268
| `--sf-color-danger-strong` | PUBLIC | consumption | Core | `light-dark( oklch(from var(--sf-color-danger-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-danger) clamp(0.70, calc(l + 0.15), 1) c h) )` |
269-
| `--sf-color-danger-subtle` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-danger) l c h / 0.1)` |
269+
| `--sf-color-danger-subtle` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-danger) l c h / 0.12)` |
270270
| `--sf-color-danger-tint` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-danger) l c h / 0.05)` |
271271
| `--sf-color-dim` | PUBLIC | knob | Core | `oklch(0 0 0 / 0.5)` |
272272
| `--sf-color-heading` | PUBLIC | consumption | Core | `light-dark( oklch(from var(--sf-color-neutral-source-light) clamp(0.05, calc(l - 0.4 - var(--sf-contrast-bias)), 0.35) c h), oklch(from var(--sf-color-neutral) clamp(0.70, calc(l + 0.25 + var(--sf-contrast-bias)), 1) c h) )` |
@@ -275,7 +275,7 @@ declared value (a value that references `var(--sf-…)` is a derived output):
275275
| `--sf-color-info-source-dark` | PUBLIC | knob | Core | `oklch(0.71 0.162 235) (registered)` |
276276
| `--sf-color-info-source-light` | PUBLIC | knob | Core | `oklch(0.48 0.18 235)` |
277277
| `--sf-color-info-strong` | PUBLIC | consumption | Core | `light-dark( oklch(from var(--sf-color-info-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-info) clamp(0.70, calc(l + 0.15), 1) c h) )` |
278-
| `--sf-color-info-subtle` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-info) l c h / 0.1)` |
278+
| `--sf-color-info-subtle` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-info) l c h / 0.12)` |
279279
| `--sf-color-info-tint` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-info) l c h / 0.05)` |
280280
| `--sf-color-inset` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-base) calc(l - 0.02) c h)` |
281281
| `--sf-color-inverse` | PUBLIC | consumption | Core | `oklch(from var(--sf-color-base) calc(1 - l) c h)` |

docs/tokens.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ rebrand workflow.
130130
| `--sf-color-danger-source-dark` | `oklch(0.71 0.198 12) *(registered)*` |
131131
| `--sf-color-danger-source-light` | `oklch(0.48 0.22 12)` |
132132
| `--sf-color-danger-strong` | `light-dark( oklch(from var(--sf-color-danger-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-danger) clamp(0.70, calc(l + 0.15), 1) c h) )` |
133-
| `--sf-color-danger-subtle` | `oklch(from var(--sf-color-danger) l c h / 0.1)` |
133+
| `--sf-color-danger-subtle` | `oklch(from var(--sf-color-danger) l c h / 0.12)` |
134134
| `--sf-color-danger-tint` | `oklch(from var(--sf-color-danger) l c h / 0.05)` |
135135
| `--sf-color-dim` | `oklch(0 0 0 / 0.5)` |
136136
| `--sf-color-heading` | `light-dark( oklch(from var(--sf-color-neutral-source-light) clamp(0.05, calc(l - 0.4 - var(--sf-contrast-bias)), 0.35) c h), oklch(from var(--sf-color-neutral) clamp(0.70, calc(l + 0.25 + var(--sf-contrast-bias)), 1) c h) )` |
@@ -139,7 +139,7 @@ rebrand workflow.
139139
| `--sf-color-info-source-dark` | `oklch(0.71 0.162 235) *(registered)*` |
140140
| `--sf-color-info-source-light` | `oklch(0.48 0.18 235)` |
141141
| `--sf-color-info-strong` | `light-dark( oklch(from var(--sf-color-info-source-light) calc(l - 0.1) c h), oklch(from var(--sf-color-info) clamp(0.70, calc(l + 0.15), 1) c h) )` |
142-
| `--sf-color-info-subtle` | `oklch(from var(--sf-color-info) l c h / 0.1)` |
142+
| `--sf-color-info-subtle` | `oklch(from var(--sf-color-info) l c h / 0.12)` |
143143
| `--sf-color-info-tint` | `oklch(from var(--sf-color-info) l c h / 0.05)` |
144144
| `--sf-color-inset` | `oklch(from var(--sf-color-base) calc(l - 0.02) c h)` |
145145
| `--sf-color-inverse` | `oklch(from var(--sf-color-base) calc(1 - l) c h)` |

user-manual/system-kolorow.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -422,57 +422,12 @@ Te nadpisania trzymaj w warstwie `slashed.overrides`, żeby przetrwały aktualiz
422422
4. **Użycie `.sf-surface--inverse` na całym ciemnym pasie z kartami i formularzem.**
423423
→ To zadanie dla `data-theme="dark"`; `.sf-surface--*` jest do pojedynczego klocka (§2).
424424
5. **Rampa numeryczna (`-200`) na elemencie pływającym nad nieznanym tłem.**
425-
→ Użyj wariantu alfa (`-subtle` / `-tint`), bo rampa jest liczona pod konkretne tło (§6).
425+
→ Użyj wariantu alfa (`-subtle` / `-tint`), bo krok rampy to kolor jednolity i nie wtapia się w nieznane tło (§6).
426426
6. **Ręczne dobieranie czerni/bieli na kolorowym tle.**`--sf-color-text--on-*` (§7).
427427

428428
---
429429

430-
## 9. Znalezione nieścisłości we frameworku
431-
432-
Podczas pisania tej instrukcji przejrzałem źródła. Poniżej to, co warto poprawić —
433-
nic krytycznego, ale realne:
434-
435-
### 9.1. Niespójna alfa w `-subtle` dla statusów *(realna nieścisłość)*
436-
437-
W `core/tokens.css` (blok „Status triplets”) warianty `-subtle` nie mają jednej alfy:
438-
439-
```css
440-
--sf-color-success-subtle: … / 0.12;
441-
--sf-color-warning-subtle: … / 0.12;
442-
--sf-color-info-subtle: … / 0.1; /* ← 10%, nie 12% */
443-
--sf-color-danger-subtle: … / 0.1; /* ← 10%, nie 12% */
444-
```
445-
446-
`success` i `warning` mają 12%, a `info` i `danger` 10% — mimo że siedzą pod tym
447-
samym komentarzem „triplet” i pełnią tę samą rolę (tło alertu). Dokumentacja
448-
(`user-manual/colors.md`) opisuje je zbiorczo jako „~12% alpha”. Efekt: pudełko
449-
alertu błędu (`danger`) będzie odrobinę bledsze niż sukcesu przy tej samej treści.
450-
**Sugestia:** ujednolicić wszystkie cztery do `0.12` (albo świadomie udokumentować
451-
różnicę). `-muted` (0.3) i `-tint` (0.05) są już spójne we wszystkich czterech.
452-
453-
### 9.2. Kolizja nazwy `-subtle` między marką a statusami *(pułapka, nie błąd)*
454-
455-
W rampach marki alias `-subtle` = `-a10` = **10%** krycia. W statusach `-subtle`
456-
(dla success/warning) = **12%**. Ta sama końcówka nazwy, inna nieprzezroczystość.
457-
Nie jest to błąd, ale łatwo o pomyłkę, gdy myślisz „subtle to zawsze 10%”. Warte
458-
zdania w dokumentacji.
459-
460-
### 9.3. Degradacja `.sf-surface--*` na starych silnikach *(świadoma, warto wiedzieć)*
461-
462-
Auto-kontrast wnętrza powierzchni (przepisanie `--sf-color-heading`,
463-
`--sf-color-link`, obramowań itd. na kolor kontrastowy) siedzi w bloku
464-
`@supports (color: oklch(from red l c h))` w `core/macros.css`. Reguła bazowa
465-
poza tym blokiem ustawia tylko `color` na samej płycie (przez `--sf-color-text--on-*`),
466-
ale **nie** przemapowuje tokenów potomków. Na silnikach bez relatywnego `oklch`
467-
(Chrome < 119, Safari < 16.4, Firefox < 128) nagłówek lub link *wewnątrz*
468-
`.sf-surface--primary` może wziąć ciemne tokeny strony i słabo kontrastować z
469-
kolorowym tłem. To celowa, udokumentowana degradacja — ale jeśli wspierasz stare
470-
przeglądarki i wkładasz nagłówki/linki do kolorowych płyt, przetestuj to albo
471-
przypnij kolory jawnie w `slashed.overrides`.
472-
473-
---
474-
475-
## 10. Ściąga „potrzebuję…”
430+
## 9. Ściąga „potrzebuję…”
476431

477432
| Potrzebuję… | Sięgam po |
478433
|---|---|

0 commit comments

Comments
 (0)