diff --git a/src/styles/anhh-tokens.css b/src/styles/anhh-tokens.css index ff91dee..1fe433c 100644 --- a/src/styles/anhh-tokens.css +++ b/src/styles/anhh-tokens.css @@ -83,3 +83,24 @@ body { line-height: 1.6; } + +/* + * Active sidebar item — Starlight default uses --sl-color-text-accent as the + * background, which on our teal (#00d4aa) gave only ~3:1 contrast against the + * dark gray text. Override with our primary blue + white text so contrast + * exceeds WCAG AA in both modes. + * + * Starlight scopes its rules via Astro's data-astro-cid-* attributes, so we + * need at least matching specificity. `:is(html)` adds a class-equivalent. + */ +/* + * Specificity bump: customCss loads BEFORE Starlight's component-scoped CSS, + * and Starlight's rule has specificity (0,2,0) via its scoped class. We use + * a doubled attribute selector + html prefix for (0,2,1) to override. + */ +html [aria-current='page'][aria-current='page'], +html [aria-current='page'][aria-current='page']:hover, +html [aria-current='page'][aria-current='page']:focus { + background-color: var(--anhh-primary); + color: #ffffff; +}