fix(web): all accent text and icons use accent-fg (#5318)
release / govulncheck (push) Successful in 17s
release / web (push) Successful in 1m11s
release / go (push) Successful in 1m26s
release / integration (push) Successful in 4m18s
release / android (push) Successful in 4m44s
release / Build signed APK (releases and dev) (push) Successful in 4m53s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 26s
release / Verify release artifacts (tag releases only) (push) Skipped

The raw accent fails AA as text on every dark surface, not only on its
own tint: 3.04:1 on the page, 2.70 on iron, 2.21 on slate, against 4.5.
accent-fg (the house formula, 45% toward parchment) measures 5.62 at
worst across both modes. The operator chose the readable colour over the
signature teal for text, on 2026-10-08.

- 36 sites swap. They are 35 Tailwind uses: links, "Now playing", the
  ingest progress line, active shuffle/repeat, the liked heart, the app
  download icon and its hover. The last is the alphabet rail's pending
  spinner in CSS. Icons follow the text: as graphics they need only
  3:1, and the raw accent misses even that on iron.
- check-tint-contrast adds accent to TEXT_NEVER_RAW, so a new raw
  text-accent or color: var(--fs-accent) fails the web lane. Run against
  the files before the swap, it finds all 36. Borders, rings and fills
  keep the raw accent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 00:17:19 -04:00
co-authored by Claude Opus 5.5
parent 37d3a5bcd3
commit b46c080d19
26 changed files with 54 additions and 42 deletions
+7 -4
View File
@@ -65,10 +65,13 @@ export function findCss(source) {
}
// Hues that fail AA as text even on a plain surface, so the raw hue is never
// text at all: error measures 2.64:1 on slate and 3.23 on iron in dark mode,
// against 4.5; error-fg measures 5.30 at worst. A border or outline in the
// hue is a graphic with a 3:1 floor and stays allowed.
export const TEXT_NEVER_RAW = ['error'];
// text at all. Dark mode, against 4.5:
// error 2.64 on slate, 3.23 on iron → error-fg 5.30 at worst
// accent 2.21 on slate, 3.04 on the page → accent-fg 5.62 at worst (#5318)
// Accent icons (the liked heart, active shuffle/repeat) follow too: as
// graphics they only need 3:1, and the raw accent misses even that on iron.
// A border or outline in the hue is a graphic and stays allowed.
export const TEXT_NEVER_RAW = ['error', 'accent'];
/** Raw text-X classes and color: var(--fs-X) for the hues above. */
export function findRawText(source) {
+7
View File
@@ -42,6 +42,13 @@ describe('hue-on-own-tint check (#3150)', () => {
expect(findRawText(`.msg { color: var(--fs-error); }`)[0].fix).toBe('var(--fs-error-fg)');
});
test('raw accent text is caught too, including hover: variants (#5318)', () => {
expect(findRawText(`<a class="text-sm text-accent hover:underline">`)[0].fix).toBe('text-accent-fg');
expect(findRawText(`<a class="hover:text-accent">`)).toHaveLength(1);
expect(findRawText(`.pending { color: var(--fs-accent); }`)[0].fix).toBe('var(--fs-accent-fg)');
expect(findRawText(`<a class="text-accent-fg border-accent">`)).toEqual([]);
});
test('passes error-fg, and error as a border or outline', () => {
expect(findRawText(`<p class="text-error-fg">x</p>`)).toEqual([]);
expect(findRawText(`<div class="border-error" class:border-error={bad}>`)).toEqual([]);