Skill Details
Runtime
(claude-5-5-sonnet)
Example user message
[userMessage]: Our dashboard's sidebar text is invisible whenever my OS is set to dark mode, but it's fine when I manually turn on our app's toggle. CSS: .sidebar { background: var(--sidebar-bg); color: var(--sidebar-fg); } and .dark .sidebar, [data-theme="dark"] .sidebar { --sidebar-bg: #1b1b1f; --sidebar-fg: #f5f5f5; } -- what's going on?
Example agent response
Found it. --sidebar-bg and --sidebar-fg are only declared inside .dark and [data-theme="dark"] -- there's no base value on :root (or on .sidebar itself). That's fine when your toggle adds the .dark class, because then one of those selectors matches. But when nobody has touched the toggle and the OS itself prefers dark, neither selector matches (you're not listening to prefers-color-scheme at all), so both custom properties are undefined -- the browser falls back to background: transparent and color: inherit (usually black), which is exactly the invisible sidebar text you're seeing.
Fix: give both tokens a base value on :root, then layer your toggle and the OS preference as overrides of that base:
:root {
--sidebar-bg: #f5f5f5;
--sidebar-fg: #1b1b1f;
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--sidebar-bg: #1b1b1f;
--sidebar-fg: #f5f5f5;
color-scheme: dark;
}
}
[data-theme="dark"] {
--sidebar-bg: #1b1b1f;
--sidebar-fg: #f5f5f5;
color-scheme: dark;
}
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-fg); }
Now the sidebar is correct whether the user never touches your toggle (OS dark), explicitly turns your toggle on, or explicitly forces light -- all three states resolve to a real color instead of falling through to the browser default.
Get this skill + 9 more with Select$14 your first month, then $19/mo$14 first month, then $19/mo
View SelectBy purchasing this skill, you agree to our terms of service
CLAUDE-5-5-SONNET
Finds the real reason a page or app looks broken in dark mode: colors defined only inside a media query, hardcoded hex values bypassing your tokens, a transparent body leaking the host background, or a missing color-scheme flag breaking native scrollbars and form controls. Paste any CSS, HTML, or component file and get an exact bug list plus the correct three-state fix: system default, explicit light override, explicit dark override.
...more
Added 5 days ago
