Repository navigation
docs(theme): state contrast thresholds and check every palette - #641
Conversation
Status colours stay the same in every palette, and --accent, the chart colours, the shadows and DocumentProgressCard keep literal values. The styling guide states the 4.5:1 text and 3:1 non-text thresholds with the known exceptions, and semantic-contrast.test.ts runs for cream and bloom as well as default. No colour values change. Refs tailor-inc/platform-planning#2208, tailor-inc/platform-planning#1892 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Metrics Report
Details | | main (bb54644) | #641 (a1bc896) | +/- |
|---------------------|----------------|----------------|--------|
| Coverage | 89.5% | 89.5% | 0.0% |
| Files | 236 | 236 | 0 |
| Lines | 7504 | 7504 | 0 |
| Covered | 6719 | 6719 | 0 |
- | Test Execution Time | 2m1s | 3m29s | +1m28s |Code coverage of files in pull request scope (100.0% → 100.0%)
Reported by octocov |
|
What do you think about using Vitest Browser Mode for these style checks? I tried it in a stacked follow-up in #652. The main benefit I see is testing the published CSS under real browser conditions. Chromium handles variable resolution, inheritance, and cascade, rather than us approximating those rules with a custom parser. We can also check whether styles actually take effect, instead of only checking the generated class names or CSS declarations. The CI runtime impact seems small, so this feels like a worthwhile trade-off for more realistic coverage and less custom test logic. Does this direction make sense to you, or do you see advantages to keeping these checks in Node? |
…alette-contrast # Conflicts: # docs-manifest.json
|
@IzumiSy Yes, I think this direction makes sense. The browser resolves variables, inheritance and the cascade, so the tests check what consumers actually get, and we can delete the custom parser. I read #652, and the thresholds and exclusions are the same, so I am happy with it. I merged |
…alette-contrast # Conflicts: # docs-manifest.json
* test(theme): move style contracts to Vitest Browser Mode * fix CI for browser style contracts Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
IzumiSy
left a comment
There was a problem hiding this comment.
It looks some updates needed in docs and decision about browser testing, but overall it's good to go.
…alette-contrast # Conflicts: # docs-manifest.json
The contrast checks moved to Vitest Browser Mode in #652. Update the styling guide and the decision record, and record why the checks run in Chromium. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#641 removed semantic-contrast.test.ts and added the dist/** exclude, so this PR now only moves theme-bridge.test.ts out of src/assets. Drop the !dist/**/*.test.* guard in files: no test file is copied into dist/ now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Why
Three open points in tailor-inc/platform-planning#2208 and tailor-inc/platform-planning#1892 needed a decision: whether status colours follow the palette, whether the remaining literal values should read scale steps, and which contrast thresholds AppShell guarantees. This PR records the decisions. No colour value changes.
Closes tailor-inc/platform-planning#2213. Addresses tailor-inc/platform-planning#1892: the thresholds are stated and tested, and the known exceptions are listed below.
What
creamandbloomkeep inheriting the hue roles. The neutral roles still follow the palette.--accent, the chart colours, the shadows andDocumentProgressCardkeep literal values.semantic-contrast.test.ts: the same checks run fordefault,creamandbloom, in light and dark mode. A new test checks that the palette files are read, so the checks cannot fall back to the default palette without notice. Most of the diff in this file is indentation from the newdescribe.each.Known exceptions
These are listed in the styling guide:
textonsurface-hoverstays at the 4.2:1 floor. Choosing another step is a visible change for a later PR.creamandbloom, the main content area is transparent over the shell gradient. At the top of thebloomlight gradient,textonsurfaceis 4.49:1 forsuccessand 4.48:1 fordanger. The earlier figure in the decision record (4.16:1) was measured on--shell-gradient-base, which the gradient covers. The new section corrects it.warningsolidandindicatorare 2.15:1 against a light card. They are used with a label.neutralintent is not checked.Checks
fmt:check,lint,type-check,test(core: 3023 tests),docs:checkandbuildpass.bloomdark--cardto red on purpose, and 17 tests failed. Then I restored it.vite.config.tssetspublicDir: "src/assets", sobuildcopies the two test files insrc/assetstodist/. A localtestrun afterbuildruns them twice, and they are in the npm package. This PR does not change that.🤖 Generated with Claude Code