From c562db8042b0b8afde5b3227d79639b5703425cc Mon Sep 17 00:00:00 2001 From: huangkevin-apr Date: Tue, 6 Jan 2026 11:30:18 +0100 Subject: [PATCH] fix(a11y): improve color contrast ratios for WCAG AA compliance --- .hugo_build.lock | 0 assets/css/_main.scss | 6 +++++- assets/css/index.scss | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .hugo_build.lock diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 000000000..e69de29bb diff --git a/assets/css/_main.scss b/assets/css/_main.scss index f6e39d578..8e11e8776 100644 --- a/assets/css/_main.scss +++ b/assets/css/_main.scss @@ -7,6 +7,8 @@ --line-height-xjumbo: 2.5rem; --font-size-mini-jumbo: 1.6rem; --line-height-mini-jumbo: 1.8rem; + /* Darker primary blue for improved contrast (white on this yields ≥4.5:1) */ + --tw-color-blue-primary-dark: #004a8d; } /* Animations */ @@ -77,7 +79,7 @@ main { // common styles across nav, header, and footer nav, .header, .footer { - background-color: var(--tw-color-blue-primary); + background-color: var(--tw-color-blue-primary-dark); color: white; @media (prefers-color-scheme: dark) { @@ -123,6 +125,8 @@ nav { .home-link { font-weight: var(--feather-font-weight-bold); + // bump up to ≥18 pt bold so that 3.0:1 white-on-blue meets WCAG Large-text contrast + font-size: var(--font-size-mini-jumbo); } #nav-menu { diff --git a/assets/css/index.scss b/assets/css/index.scss index 97902472c..84d3185a3 100644 --- a/assets/css/index.scss +++ b/assets/css/index.scss @@ -22,6 +22,15 @@ height: 500px; } +// ensure sufficient contrast on the Twitter embed link +// target the bearing the .twitter-timeline class itself, +// plus any nested anchors under .twitter-timeline or .timeline-cell +.twitter-timeline, +.twitter-timeline a, +.timeline-cell a { + color: var(--tw-color-blue-primary-dark) !important; +} + @media (min-width: 600px) { #follow-us .container {