← ClaudeAtlas

light-dark-modelisted

Load this skill whenever the project supports light/dark mode, colour theme switching, high-contrast mode, or responds to prefers-color-scheme. Under no circumstances hard-code colours that break in alternative themes. Absolutely always test colour contrast in both light and dark themes, and respect user OS-level colour preferences via CSS media queries.
mgifford/accessibility-skills · ★ 15 · AI & Automation · score 77
Install: claude install-skill mgifford/accessibility-skills
# Light/Dark Mode Accessibility Skill > **Canonical source**: `examples/LIGHT_DARK_MODE_ACCESSIBILITY_BEST_PRACTICES.md` in `mgifford/ACCESSIBILITY.md` > This skill is derived from that file. When in doubt, the example is authoritative. Apply these rules whenever implementing or reviewing colour theme support in HTML, CSS, or JavaScript. **Only load this skill if the project supports light/dark mode or user theme switching.** --- ## Core Mandate All colour themes **must** meet WCAG 2.2 Level AA contrast in **both** light and dark modes, including forced-colours / high contrast modes. Test all three — not just the default. --- ## Severity Scale (this skill) | Level | Meaning | | --- | --- | | **Critical** | Colour theme makes content or interaction completely inaccessible | | **Serious** | Contrast or mode failure significantly impairs access for a disability group | | **Moderate** | Theme degrades usability but content remains partially accessible | | **Minor** | Best-practice gap; marginal impact | --- ## Required: CSS Custom Properties Pattern Always use CSS custom properties for theme tokens. Never hardcode colour values in component styles — hardcoded values cannot be overridden by the theme system or user preferences. ```css :root { --color-text: #1a1a1a; --color-background: #ffffff; --color-link: #0066cc; --color-focus: #004499; --color-border: #cccccc; --color-hover: #f5f5f5; } @media (prefers-color-scheme: dark) { :