Repository navigation
test(theme): move style contracts to Vitest Browser Mode - #652
Merged
IzumiSy merged 3 commits intoOct 28, 2026
Merged
Conversation
Contributor
Author
|
@copilot fix CI errors |
Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
Contributor
Contributor
Code Metrics Report
Details | | main (1411958) | #652 (240f7f6) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 89.4% | 89.4% | 0.0% |
| Files | 234 | 234 | 0 |
| Lines | 7308 | 7308 | 0 |
| Covered | 6540 | 6540 | 0 |
- | Test Execution Time | 2m15s | 2m36s | +21s |Code coverage of files in pull request scope (100.0% → 100.0%)
Reported by octocov |
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
…rast' into test/browser-style-contracts # Conflicts: # packages/core/package.json # pnpm-lock.yaml Co-authored-by: IzumiSy <982850+IzumiSy@users.noreply.github.com>
Contributor
Resolved and merged the PR base in |
IzumiSy
marked this pull request as ready for review
October 28, 2026 02:34
IzumiSy
merged commit Oct 28, 2026
3feac2f
into
docs/semantic-color-palette-contrast
6 checks passed
wemra3
pushed a commit
that referenced
this pull request
Oct 28, 2026
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>
wemra3
added a commit
that referenced
this pull request
Oct 28, 2026
* docs(theme): state contrast thresholds and check every palette 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> * test(theme): move style contracts to Vitest Browser Mode (#652) * 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> * docs(theme): describe the browser contrast tests 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> --------- Co-authored-by: Hiroki Uemura <hiroki_uemurapartners.tailor.tech@Hirokis-MacBook-Pro.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Seiya IZUMI <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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Stacked on #641, with
docs/semantic-color-palette-contrastas the base branch.The existing contrast tests interpret theme CSS with a handwritten parser, while component snapshots only record class names. Neither proves that the published styles resolve correctly when combined with consumer utilities. Move CSS-dependent checks into a real browser without losing the existing palette, contrast or compatibility guarantees.
Design Decision
Let the browser resolve CSS
Use Vitest Browser Mode with Chromium and the public built stylesheet entrypoint. This exercises variable resolution, inheritance and cascade instead of maintaining a partial CSS engine in the tests. Canvas handles colour parsing and alpha compositing; contrast sampling remains limited to flat backgrounds at 8-bit precision.
Keep structural checks fast
Retain bridge completeness, alias reference chains and all-role typography declaration checks in the Node-based suite. Replace the modifier-only compile checks with computed-style assertions. Existing contrast thresholds and documented exclusions are unchanged.
Summary