fix(a11y): focus indicators meet the 3:1 non-text contrast bar (#574)

Fixes #568. Adds a real --color-ring token (ink orange #A85518 light / #F0A766 dark) and sweeps all 57 focus-indicator occurrences onto it: soft opacity rings blended to 1.2-1.7:1, border-only indicators sat at 2.6-3.0:1, and four focus:ring-ring sites referenced a token that never existed. Sponsor button keeps pink via pink-700; range sliders and the file list gain their missing keyboard indicators; landing skip link and form borders hardened; the palette contrast guard pins the ring at 3:1 in both themes.
This commit is contained in:
SnapOtter
2026-07-19 16:23:15 +08:00
committed by GitHub
parent 51022628dc
commit 6339370093
35 changed files with 83 additions and 59 deletions
+14
View File
@@ -127,6 +127,20 @@ describe("web dark theme", () => {
});
});
describe("focus ring (issue #568)", () => {
it("ring meets 3:1 non-text contrast (WCAG 1.4.11) on light surfaces", () => {
for (const bg of ["background", "card", "muted", "primary-subtle", "sidebar"]) {
expectPair(webLight, "ring", bg, 3);
}
});
it("ring meets 3:1 non-text contrast on dark surfaces", () => {
for (const bg of ["background", "card", "muted", "sidebar"]) {
expectPair(webDark, "ring", bg, 3);
}
});
});
describe("landing", () => {
it("ink text passes AA on light surfaces", () => {
for (const bg of ["background", "surface", "background-alt", "primary-subtle"]) {