diff --git a/src/astro/Sidebar.astro b/src/astro/Sidebar.astro index 8c1333d..abd3e8f 100644 --- a/src/astro/Sidebar.astro +++ b/src/astro/Sidebar.astro @@ -50,7 +50,11 @@ function isActive(href: string): boolean { aria-current={isActive(item.href) ? 'page' : undefined} class:list={[ 'min-h-0 justify-start py-1.5 text-start', - isActive(item.href) && 'menu-active bg-base-100 font-medium', + // daisyUI `menu-active` sets the foreground to + // `neutral-content`, which can be unreadable on the + // `base-100` pill we pair it with (e.g. kolektiv-dark). + // `text-base-content` supplies the matching foreground. + isActive(item.href) && 'menu-active bg-base-100 text-base-content font-medium', ]} > {item.icon && ( diff --git a/src/styles/chrome.css b/src/styles/chrome.css index 631271e..3517a66 100644 --- a/src/styles/chrome.css +++ b/src/styles/chrome.css @@ -57,6 +57,17 @@ html { border-color: var(--color-base-content); } +/* ---- Sidebar active link ---- */ + +/* daisyUI's `.menu-active` colours the label with `neutral-content`, which is + * unreadable on the `base-100` pill Sidebar pairs it with in some themes (for + * example kolektiv-dark). Force the base foreground/background pair. Scoped to + * `aria-current`, which search-dialog hits do not set, so they keep daisyUI's + * readable `neutral` / `neutral-content` pair. */ +.menu a[aria-current='page'] { + color: var(--color-base-content); +} + /* ---- Segmented toggles (language / framework) ---- */ .kdc-toggle:has(input:checked) {