Skip to content

fix(a11y): the ghost button's ink was chosen for a white page that does not exist - #4

Open
drsamonline wants to merge 1 commit into
mainfrom
fix/ghost-ink-contrast
Open

drsamonline wants to merge 1 commit into
mainfrom
fix/ghost-ink-contrast

Conversation

@drsamonline

Copy link
Copy Markdown
Owner

The failure

audit → contrast failed on 2026-11-23 (run 45214674681) with exactly one unreadable text run:

app-jacquard   checked=18 unreadable=1  [('A', 'Read the referen', 1.63, (14, 12, 8))]

1.63:1 — the sampled background is (14,12,8) = #0e0c08, i.e. the page's own dark body.

The cause

A later override in docs/index.html said:

/* .btn.ghost set rgb(233,226,212) unconditionally while the page behind it is
   white in both themes: 1.29:1. The page does not change with the theme ... */
.btn.ghost{color:#3f3529!important}

The page is not white in either theme. body paints #0e0c08; the light-theme block overrides --paper and --line, not the body background. So the override put a dark ink on a dark page. docs/play/index.html carries the same override for .support-open.

The fix

Remove both overrides. Each control keeps its own ink from its base rule — #e9e2d4 on #0e0c08 is 15.9:1. The code chip rule stays: it is a light chip on the same dark page, so its dark ink is correct.

The guard

test-node.js now derives the ratio from the CSS itself — the ink the browser will actually use (last color for the control) against the last colour body actually paints — for both pages and both controls.

Verified by mutation:

mutation result
.btn.ghost{color:#3f3529!important} put back on the landing page docs/index.html: .btn.ghost ink #3f3529 reads on #0e0c08 (1.63:1, needs 4.5:1)
.support-open{color:#3f3529!important} put back on the play page docs/play/index.html: .support-open ink #3f3529 reads on #0e0c08 (1.63:1, needs 4.5:1)

The number it reports is the number the fleet gate reported.

Proof

node test-node.js — 115 passed, 0 failed (was 112 + the new checks).

Once merged, the next audit → contrast run should be clean for this repository.

…es not exist

The fleet contrast gate failed on 2026-11-23 with
app-jacquard ('A', 'Read the referen', 1.63, (14, 12, 8)) - one text run at
1.63:1.

Cause: a later override set .btn.ghost{color:#3f3529!important} on the theory
that 'the page behind it is white in both themes'. It is not. body paints
#0e0c08 in both themes - the light-theme block overrides --paper and --line,
not the body background - so a dark ink landed on a dark page. docs/play/
carried the same override for .support-open.

Fix: remove both overrides and let each control keep its own light ink
(#e9e2d4 on #0e0c08 = 15.9:1). The code chip's dark ink stays: it is a light
chip on the same dark page, and it is readable.

Guard: test-node.js now computes WCAG contrast from the CSS itself - the ink the
browser will use against the last colour body actually paints - for both pages
and both controls. Verified by mutation: putting either override back fails the
suite with the same 1.63:1 the gate reported.

node test-node.js: 115 passed, 0 failed.

This branch has not been deployed

No deployments
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