Skip to content

test(theme): check neutral contrast and forbid deprecated colour tokens in core - #662

Open
wemra3 wants to merge 2 commits into
mainfrom
test/colour-guards
Open

wemra3 wants to merge 2 commits into
mainfrom
test/colour-guards

Conversation

@wemra3

@wemra3 wemra3 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Part of tailor-inc/platform-planning#2208. Two small follow-ups:

Summary

  • tests/browser/semantic-contrast.test.ts: checks the neutral intent in every palette and mode. text on surface and surface-hover (over --card and --background), and contrast on solid and solid-hover, must be at least 4.5:1. All 36 new checks pass. The lowest value in the default palette is 12.6:1.
  • New tests/deprecated-colour-utilities.test.ts (Node): scans src/**/*.{ts,tsx} (not tests) for the deprecated utilities, with or without astw: and variants, and for the deprecated CSS variables. It finds none today.
  • Styling guide: the neutral intent is no longer listed as unchecked. Decision record: the exception is marked as resolved.
  • No changeset: the change is tests and one docs line, so consumers do not need to do anything. No colour value changes.

Checks

  • type-check, lint, fmt:check and docs:check pass. Node tests and test:browser (378 contrast tests) pass.
  • I added hover:bg-destructive/10 to badge.tsx on purpose, and the new Node test failed with components/badge/badge.tsx: bg-destructive. Then I removed it.
  • This PR and docs(theme): keep the hover step and record why #661 both edit the decision record and docs-manifest.json. The decision record merges cleanly. For the manifest, run pnpm docs:sync in the PR that merges second.

🤖 Generated with Claude Code

…ns in core

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wemra3
wemra3 requested a review from a team as a code owner October 30, 2026 00:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (9f68121) #662 (51c4cb4) +/-
Coverage 89.5% 89.5% 0.0%
Test Execution Time 2m56s 2m42s -14s
Details
  |                     | main (9f68121) | #662 (51c4cb4) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          89.5% |          89.5% | 0.0% |
  |   Files             |            236 |            236 |    0 |
  |   Lines             |           7517 |           7517 |    0 |
  |   Covered           |           6732 |           6732 |    0 |
+ | Test Execution Time |          2m56s |          2m42s | -14s |

Reported by octocov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant