feat(tokens): four severity levels plus a stale state (#174) #225

Merged
peterswimm merged 1 commit from feat/174-severity-tokens into main 2026-10-23 13:43:33 +00:00
Member

Refs #174. Does not close it.

Scope

The DTCG entries and the Part 1 spec update that Peter approved in #174 (2026-10-21). One family of changes: four severity levels plus a stale state.

  • Baseline dark values: accent.success #4ADE80, accent.warning #FB923C, accent.error #F87171. The light values are unchanged.
  • New accent.critical: light #960157, dark #E65D9B.
  • New neutral.warm-stale: light #706052, dark #A39283.
  • Rituals dark accent.error: #BE5656 to #F87171.
  • New text.on-accent-dark in the baseline and in Rituals. text.on-success dark is now #2C1A17.
  • extract.py short aliases and wcag.py pairs for the new tokens.
  • Brand/specs/spelwork/spelwork-dashboard-design-part1.md: source paths and section 3 updated.

Not in this PR: any SPELWork palette change, any light-value change, any change to text.on-accent, any Rituals app code.

Testing

No new unit tests. The behaviour change is in the wcag.py pair list, and wcag.py check --all is the gate for it.

  • just build and just check pass (each recipe command was run directly because just is not installed on this machine). All 13 check commands pass.
  • python3 -m pytest generator/tests/: 400 passed, 20 skipped.
  • The new pairs run in toilville, wp-themes, rituals and blocks. Contrast on the new dark fills with #2C1A17: success 9.51, warning 7.32, error 5.99, critical 5.05, stale 5.52. Rituals error is 5.99 in dark and vanillanight, and 8.29 in the light themes.
  • Before this change the new dark values failed with white text (error 2.8:1, warning 2.3:1, success 1.7:1).

Impact Statement

  • Existing features: dark accent.success, accent.warning and accent.error change in toilville and wp-themes. Rituals and blocks change only dark accent.error. Light themes are unchanged.
  • Public APIs / contracts: new CSS vars --critical, --neutral-warm-stale and --text-on-accent-dark. New Dart and Swift keys accentCritical, neutralWarmStale and textOnAccentDark. text.on-accent is unchanged.
  • Schemas: none.
  • Data / artifacts: dist/ regenerated for toilville, wp-themes, rituals and blocks. dist/rituals/udg_tokens.{dart,json,swift} gain textOnAccentDark and the new accentError dark value.
  • Integrations: the Rituals native token files change as above. The Rituals Dart registry already defines textOnAccentDark with the same values. Rituals app code is not touched.
  • Mappings: wcag.py pairs. Error, critical and stale pair with text.on-accent-dark. Warning pairs with it in toilville and wp-themes, and stays on text.on-accent in rituals and blocks.
  • Backward compatibility: any consumer that puts white text.on-accent on the dark --error or --warning fill in toilville or wp-themes now fails AA. Those consumers should use --text-on-accent-dark. No such use exists in components/ or templates/.

Docs

Part 1 spec updated: source paths, section 3, known issues, open questions.

Remaining review points

  1. Light-theme lightness order is not met. #174 asks for lightness to step in order from fine to very serious. The dark theme meets it (OKLCH L 0.800, 0.758, 0.711, 0.670). The light theme does not: success 0.550, warning 0.586, error 0.577. Only accent.critical (0.440) is out in front. Fixing it means changing the existing light success, warning and error values. #174 did not approve that, so they are unchanged. Recorded in the Part 1 spec.
  2. SPELWork does not receive the new tokens. udg/products/spelwork/meta.yml has color_inherits_baseline: false. That is an intentional choice (0f43e6e). SPELWork's palette has no accent.* and no dark theme. The delivery question is recorded as open in the Part 1 spec and in Part 2 rows 5 and 11. This PR does not change it.
  3. Rituals and blocks do not receive accent.critical or neutral.warm-stale. They carry their own full palettes. Whether they should is open. Both keep their own saturated-red warning (#EE0000).
  4. text.on-accent-dark is new in the baseline DTCG. It formalizes the on-colour pattern from design #28 (text.on-success, text.on-secondary) and the textOnAccentDark role the Rituals app already has. It is needed so the new bright dark-mode fills pass WCAG. Peter's approval in #174 did not name it.
  5. Nothing checks neutral.warm-stale or accent.critical as text on a surface. Only the fill pairs are added.
Refs #174. Does not close it. ## Scope The DTCG entries and the Part 1 spec update that Peter approved in #174 (2026-10-21). One family of changes: four severity levels plus a stale state. - Baseline dark values: `accent.success` `#4ADE80`, `accent.warning` `#FB923C`, `accent.error` `#F87171`. The light values are unchanged. - New `accent.critical`: light `#960157`, dark `#E65D9B`. - New `neutral.warm-stale`: light `#706052`, dark `#A39283`. - Rituals dark `accent.error`: `#BE5656` to `#F87171`. - New `text.on-accent-dark` in the baseline and in Rituals. `text.on-success` dark is now `#2C1A17`. - `extract.py` short aliases and `wcag.py` pairs for the new tokens. - `Brand/specs/spelwork/spelwork-dashboard-design-part1.md`: source paths and section 3 updated. Not in this PR: any SPELWork palette change, any light-value change, any change to `text.on-accent`, any Rituals app code. ## Testing No new unit tests. The behaviour change is in the `wcag.py` pair list, and `wcag.py check --all` is the gate for it. - `just build` and `just check` pass (each recipe command was run directly because `just` is not installed on this machine). All 13 check commands pass. - `python3 -m pytest generator/tests/`: 400 passed, 20 skipped. - The new pairs run in `toilville`, `wp-themes`, `rituals` and `blocks`. Contrast on the new dark fills with `#2C1A17`: success 9.51, warning 7.32, error 5.99, critical 5.05, stale 5.52. Rituals error is 5.99 in `dark` and `vanillanight`, and 8.29 in the light themes. - Before this change the new dark values failed with white text (error 2.8:1, warning 2.3:1, success 1.7:1). ## Impact Statement - Existing features: dark `accent.success`, `accent.warning` and `accent.error` change in `toilville` and `wp-themes`. Rituals and `blocks` change only dark `accent.error`. Light themes are unchanged. - Public APIs / contracts: new CSS vars `--critical`, `--neutral-warm-stale` and `--text-on-accent-dark`. New Dart and Swift keys `accentCritical`, `neutralWarmStale` and `textOnAccentDark`. `text.on-accent` is unchanged. - Schemas: none. - Data / artifacts: `dist/` regenerated for `toilville`, `wp-themes`, `rituals` and `blocks`. `dist/rituals/udg_tokens.{dart,json,swift}` gain `textOnAccentDark` and the new `accentError` dark value. - Integrations: the Rituals native token files change as above. The Rituals Dart registry already defines `textOnAccentDark` with the same values. Rituals app code is not touched. - Mappings: `wcag.py` pairs. Error, critical and stale pair with `text.on-accent-dark`. Warning pairs with it in `toilville` and `wp-themes`, and stays on `text.on-accent` in `rituals` and `blocks`. - Backward compatibility: any consumer that puts white `text.on-accent` on the dark `--error` or `--warning` fill in `toilville` or `wp-themes` now fails AA. Those consumers should use `--text-on-accent-dark`. No such use exists in `components/` or `templates/`. ## Docs Part 1 spec updated: source paths, section 3, known issues, open questions. ## Remaining review points 1. **Light-theme lightness order is not met.** #174 asks for lightness to step in order from fine to very serious. The dark theme meets it (OKLCH L 0.800, 0.758, 0.711, 0.670). The light theme does not: success 0.550, warning 0.586, error 0.577. Only `accent.critical` (0.440) is out in front. Fixing it means changing the existing light success, warning and error values. #174 did not approve that, so they are unchanged. Recorded in the Part 1 spec. 2. **SPELWork does not receive the new tokens.** `udg/products/spelwork/meta.yml` has `color_inherits_baseline: false`. That is an intentional choice (`0f43e6e`). SPELWork's palette has no `accent.*` and no dark theme. The delivery question is recorded as open in the Part 1 spec and in Part 2 rows 5 and 11. This PR does not change it. 3. **Rituals and `blocks` do not receive `accent.critical` or `neutral.warm-stale`.** They carry their own full palettes. Whether they should is open. Both keep their own saturated-red warning (`#EE0000`). 4. **`text.on-accent-dark` is new in the baseline DTCG.** It formalizes the on-colour pattern from design #28 (`text.on-success`, `text.on-secondary`) and the `textOnAccentDark` role the Rituals app already has. It is needed so the new bright dark-mode fills pass WCAG. Peter's approval in #174 did not name it. 5. **Nothing checks `neutral.warm-stale` or `accent.critical` as text on a surface.** Only the fill pairs are added.
feat(tokens): four severity levels plus a stale state (#174)
All checks were successful
PR policy check / policy-gate (pull_request) Successful in 0s
UDG dist drift gate / dist/ matches dtcg + udg sources (pull_request) Successful in 22s
Test Generator / lint-workflows (pull_request) Successful in 24s
Test Generator / lint-prose (pull_request) Successful in 31s
Security Scans / Trivy filesystem scan (pull_request) Successful in 47s
Security Scans / Gitleaks secret scan (pull_request) Successful in 47s
Copy coverage / Design copy reaching rendered HTML (pull_request) Successful in 52s
Block Validation / validate (pull_request) Successful in 1m8s
Test Generator / test (pull_request) Successful in 4m12s
095719a09f
Peter approved the severity model on 2026-10-21: four levels plus a
separate stale state, real dark values for the baseline success, warning
and error, and Rituals dark accent.error #F87171.

Baseline Brand/UDG/dtcg/color.json:
- accent.success dark #4ADE80, accent.warning dark #FB923C, accent.error
  dark #F87171. The light values are unchanged.
- new accent.critical: light #960157, dark #E65D9B.
- new neutral.warm-stale: light #706052, dark #A39283.
- new text.on-accent-dark: light #FFFFFF, dark #2C1A17. The same pair the
  Rituals app already resolves as textOnAccentDark. The new dark fills
  are light, so white text on them fails AA.
- text.on-success dark is #2C1A17 (light stays white).

Rituals Brand/UDG/products/rituals/dtcg/color.json:
- accent.error dark #BE5656 -> #F87171 (3.75:1 on cocoa, failed AA).
- text.on-accent-dark: light #FFFFFF, dark and vanillanight #2C1A17.

Generators:
- extract.py: SHORT_ALIAS for accent.critical, neutral.warm-stale and
  text.on-accent-dark.
- wcag.py: error, critical and stale pair with text.on-accent-dark.
  Warning pairs with it in toilville and wp-themes only. Rituals and
  blocks keep their saturated-red warning (#EE0000), where white passes
  (4.53:1) and the dark ink does not (3.66:1).

Part 1 spec: source paths updated, section 3 rewritten to the decided
model, known issues and open questions recorded.

dist/ regenerated with just build. just check passes.
peterswimm deleted branch feat/174-severity-tokens 2026-10-23 13:43:33 +00:00
Sign in to join this conversation.
No description provided.