fix(tokens): WCAG AA Normal by default for every brand & status on-color (Phase 2 redo) - #36
Conversation
…ar AA Normal The sign(0.6 - l) auto-contrast picker is binary, so every brand and status colour with L between roughly 0.51 and 0.65 falls into a contrast valley with white-or-black text. Defaults are now picked to sit safely below the 0.6 threshold, so every on-color clears WCAG AA Normal (4.5:1) — previously only AA Large for several families. --sf-color-tertiary-light: oklch(0.55 0.14 310) -> oklch(0.48 0.14 310) --sf-color-neutral-light: oklch(0.55 0.02 260) -> oklch(0.45 0.02 260) --sf-color-success-light: oklch(0.55 0.17 150) -> oklch(0.48 0.17 150) --sf-color-info-light: oklch(0.55 0.15 240) -> oklch(0.48 0.15 240) Empirical sRGB contrast (culori-resolved oklch -> WCAG luminance): primary 6.79 secondary 13.83 tertiary 6.06 action 5.86 neutral 6.43 success 5.14 warning 9.09 error 5.16 info 5.45 danger 5.95 This is a BREAKING change to default brand/status palettes — any consumer relying on the exact previous oklch values must override. tests/tokens.spec.js: raise the on-color contrast threshold from 3:1 to 4.5:1 across all 11 families. The previous 3:1 bar masked the regression captured by F-06 and would have masked a similar latent failure on success/info. docs/architecture.md: 'Known intentional tradeoffs' rewritten -- the binary L=0.6 threshold is still documented as a tradeoff, but the default palette now clears AA Normal across the board. Co-authored-by: Jack Granatowski <contact@codeslash.net>
- audits/comparative-audit-2026.md: append Phase 2 entries for F-06 (with the four-family default-tightening), F-09 (text--inverse clamp widening), F-21 (visited link 60-degree shift + override comment), and N-01 (test threshold raise to 4.5:1). Strike F-06 in the P0 roadmap. - docs/demo.html: refresh HEX_FALLBACKS to approximate the new oklch defaults for tertiary and neutral. These fallbacks only matter for engines that fail to resolve oklch (none on the supported floor), so this is a cosmetic alignment, not a behaviour change. Co-authored-by: Jack Granatowski <contact@codeslash.net>
📝 WalkthroughWalkthroughThis PR implements Phase 2 of the comparative audit's contrast discipline initiative. Brand and status token source lightness values are lowered, the inverse text clamp range is adjusted, and visited-link hue shift increases from +40 to +60. The WCAG on-color assertion threshold is raised to AA Normal (4.5:1), and documentation and audit log are updated accordingly. ChangesPhase 2 Contrast Discipline Token Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@audits/comparative-audit-2026.md`:
- Line 1498: Update the audit note so it matches the actual text in
docs/architecture.md: open the "Known intentional tradeoffs" section and confirm
whether the doc declares the "AA Normal default contract" and whether it
identifies "warning" as a documented exception; then edit line 1498 of
comparative-audit-2026.md to state exactly what docs/architecture.md asserts
(either that "warning" is the single documented exception, that another
exception is documented, or that no single exception is claimed) and reference
the exact phrase used in the architecture doc so the audit entry aligns with the
source.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 01d9a617-8108-4a06-a411-0984f6401260
⛔ Files ignored due to path filters (2)
dist/slashed.essential.cssis excluded by!**/dist/**dist/slashed.full.cssis excluded by!**/dist/**
📒 Files selected for processing (5)
audits/comparative-audit-2026.mdcore/tokens.cssdocs/architecture.mddocs/demo.htmltests/tokens.spec.js
| | F-21 | `--sf-color-link--visited` hue shift increased from `+40°` to `+60°`. Inline comment now points integrators at the direct override path for brands where action and tertiary hues sit close together. | | ||
| | N-01 (new) | `tests/tokens.spec.js` raised the on-color contrast threshold from 3:1 to 4.5:1 across all 11 brand and status families. The previous lower bar would have masked the regression captured by F-06. | | ||
|
|
||
| `docs/architecture.md` — "Known intentional tradeoffs" rewritten to declare the AA Normal default contract and identify `warning` as the single documented exception. |
There was a problem hiding this comment.
Correct Phase 2 log claim about the documented exception.
Line 1498 says docs/architecture.md now identifies warning as the single documented exception, but the updated architecture text does not state that. Please align this line with the actual docs content to avoid audit-trace drift.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@audits/comparative-audit-2026.md` at line 1498, Update the audit note so it
matches the actual text in docs/architecture.md: open the "Known intentional
tradeoffs" section and confirm whether the doc declares the "AA Normal default
contract" and whether it identifies "warning" as a documented exception; then
edit line 1498 of comparative-audit-2026.md to state exactly what
docs/architecture.md asserts (either that "warning" is the single documented
exception, that another exception is documented, or that no single exception is
claimed) and reference the exact phrase used in the architecture doc so the
audit entry aligns with the source.
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Why this PR exists
Phase 2 (#35) was approved and clicked-merge, but its
base.refwaschore/phase-1-truthfulness(the now-deleted Phase 1 branch) instead ofmain. After Phase 1 (#34) merged intomain, GitHub did not auto-rebase Phase 2's base, so the merge of #35 (f463c0b0…) landed on the soon-to-be-stale Phase 1 branch and never propagated tomain.Empirical evidence on the current
main(940615f):core/tokens.css:18still reads--sf-color-tertiary-light: oklch(0.55 0.14 310)(Phase 2 was supposed to lower it to0.48)audits/comparative-audit-2026.mdResolution Log has only the Phase 1 sectionThis PR is a byte-for-byte re-application of #35's two commits onto current
main— same diff, same commit messages, same author trailers. It exists purely to put the Phase 2 changes where they were always meant to be.What's in this PR
Two commits, taken verbatim from #35 (cherry-picked via
git amfrom the.patchfiles of48f422d3and51055783):fix(tokens): lower default L for tertiary/neutral/success/info to clear AA Normalcore/tokens.css— four@propertyinitial-values and the four:rootdefaults:--sf-color-tertiary-light:oklch(0.55 0.14 310)→oklch(0.48 0.14 310)--sf-color-neutral-light:oklch(0.55 0.02 260)→oklch(0.45 0.02 260)--sf-color-success-light:oklch(0.55 0.17 150)→oklch(0.48 0.17 150)--sf-color-info-light:oklch(0.55 0.15 240)→oklch(0.48 0.15 240)--sf-color-text--inverseclamp widened in light mode:0.70..1→0.85..0.98(F-09).+40°→+60°with override-path comment for brand collisions (F-21).tests/tokens.spec.js— on-color contrast threshold raised from AA Large (3:1) to AA Normal (4.5:1) for all 11 brand & status families. The previous bar masked F-06 and a similar latent failure onsuccess/info.docs/architecture.md— "Known intentional tradeoffs" rewritten: defaults clear AA Normal across the board;sign(0.6 - l)mechanism kept, only the defaults moved out of its valley.docs: update audit Phase 2 resolution log and demo customizer fallbacksaudits/comparative-audit-2026.md— appended Phase 2 entries (F-06, F-09, F-21, N-01); F-06 struck from the P0 roadmap.docs/demo.html—HEX_FALLBACKSfor tertiary/neutral approximated to the new oklch defaults. These hex fallbacks only fire on engines that fail to resolveoklch(i.e., none on the supported floor) — purely cosmetic alignment.Empirical contrast (sRGB, WCAG luminance, culori-resolved oklch)
Every chromatic on-color now sits at or above 5:1.
This is a default-palette shift. Any consumer relying on the exact previous
oklch(0.55 …)values for tertiary/neutral/success/info must override them in their own:root. The override path is unchanged:Verification
npm run lint:css— cleannpm run build— both bundles regenerate;dist/slashed.{essential,full}.cssupdateddist/: every*-lightvalue reflects the new oklch defaultstests/tokens.spec.js— Playwright suite runs on CI (Ubuntu); local sandbox can't install browser deps but the assertions are unchanged from fix(tokens): clear WCAG AA Normal by default for every brand & status on-color (Phase 2) #35 which already validated against the same fixture-based contrast resolutionResolves
F-06, F-09, F-21, plus the latent AA Normal failures on
successandinfothat the original audit missed (caught by raising the test threshold to 4.5).Stacking
This unblocks Phase 3 (Print color preservation, PR-3), which I'll open against
mainimmediately after this merges.Summary by CodeRabbit
New Features
Bug Fixes
Documentation