dark-mode-design
Skill4 starsChanged 3 months agoApache-2.0View on GitHub
Implement dark mode as a first-class citizen, not an afterthought. Covers elevation through luminance, surface hierarchy, color adaptation, image handling, and token architecture for multi-mode design systems. Use when implementing dark mode, defining dark theme tokens, or testing dark themes. Triggers on: "dark mode", "dark theme", "elevation", "night mode", "theme switching", "dark UI", "OLED design".
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
No room for elevation hierarchy
- Distinctive: line 49
Test all brand colors on dark surfaces
- Very specific: line 112
Always default to prefers-color-scheme, with optional manual override:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dark Mode Design
Dark mode is not light mode inverted. It's a distinct design that requires its own surface hierarchy, color logic, and testing approach.
The Core Principle: Elevation Through Luminance
On light backgrounds, elevation is shown with shadows (darker = higher). On dark backgrounds, shadows don't read. Instead, elevated surfaces get lighter.
| Elevation Level | Light Mode | Dark Mode |
| Base | #FFFFFF | #121212 |
| Surface (cards) | #FFFFFF + shadow | #1E1E1E |
| Raised (dropdowns) | #FFFFFF + larger shadow | #272727 |
| Overlay (modals) | #FFFFFF + backdrop blur | #323232 |
Surface Tokens (Minimum 4 Levels)
dark/surface/base = #121212 (deepest, page background)
dark/surface/raised = #1E1E1E (cards, panels)
dark/surface/elevated = #272727 (dropdowns, menus, hover)
dark/surface/overlay = #323232 (modals, dialogs, tooltips)Never Use Pure Black
Pure black (#000000) causes:
- Excessive contrast with white text (halation effect)
- No room for elevation hierarchy
- Lost depth cues on OLED (true black = off = no shadow visible)
Use #121212 to #1E1E1E as base.
Color Adaptation
Brand Colors
- Desaturate by 10-20% for dark surfaces (fully saturated colors vibrate)
- Lighten primary for better contrast on dark backgrounds
- Test all brand colors on dark surfaces
Semantic Colors
| Intent | Light Mode | Dark Mode |
| Error | #D32F2F | #EF5350 (lighter for visibility) |
| Warning | #F9A825 | #FFD54F |
| Success | #388E3C | #66BB6A |
Text Colors
- Primary text: #E0E0E0 (87% white, not pure white)
- Secondary text: #A0A0A0 (60% white)
- Disabled text: #6E6E6E (38% white)
- Pure white (#FFFFFF): reserved for emphasis only
Image & Media Handling
| Element | Treatment |
| Photos | Slight brightness reduction or subtle overlay to prevent harsh contrast |
| Transparent PNGs | Add subtle background behind dark-on-transparent assets |
| SVG icons | Use currentColor so they adapt automatically |
| Illustrations | Provide dark-mode variants or apply brightness filter |
Shadow Replacement
On dark backgrounds, replace shadows with:
| Instead of... | Use... |
box-shadow: 0 2px 4px rgba(0,0,0,0.2) | Lighter surface color + subtle border |
| Large drop shadows | Surface color change + 1px border in rgba(255,255,255,0.05) |
| Inner shadows | Slightly darker tint on the surface |
Implementation Architecture
CSS Custom Properties Approach
:root {
--surface-base: #FFFFFF;
--surface-raised: #FFFFFF;
--text-primary: rgba(0, 0, 0, 0.87);
/* shadows for light mode */
}
[data-theme="dark"] {
--surface-base: #121212;
--surface-raised: #1E1E1E;
--text-primary: rgba(255, 255, 255, 0.87);
/* borders instead of shadows */
}Tailwind CSS
// tailwind.config.js
module.exports = {
darkMode: 'class', // or 'media'
// dark: prefix works automatically
}Respecting System Preference
Always default to prefers-color-scheme, with optional manual override:
- Check
prefers-color-scheme: dark - Allow user toggle (stored in localStorage)
- Apply theme class before render to prevent flash
Testing Checklist
- All text meets WCAG AA on dark surfaces (4.5:1 for body)
- All interactive states visible (hover, focus, active, disabled)
- No pure black backgrounds (#000000)
- Images don't become invisible or harsh
- Shadows replaced with borders/surface changes
- Tested on OLED and LCD screens
- Tested with color blindness simulators
- Smooth theme transition (no jarring flash)
- Third-party embeds handled (may need overrides)
Reference Map
references/surface-token-map.md— luminance elevation ladder, text opacity, shadow swapsreferences/contrast-adaptation.md— WCAG 2.2 contrast QA and brand/media adaptation
Related Skills
- For design tokens → use
design-systems - For color and contrast → use
ui-visual-design - For accessibility testing → use
a11y-accessibility-design
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- launchapp-dev/animus-cli★ 39same name
- miovrag/claude-skills★ 1same name
- davidanthonyn/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository80 other files it gives its agents.
- a11y-accessibility-designSkill
- agentic-ui-patternsSkill
- ai-native-ui-designSkill
- ai-ui-anti-patternsSkill
- ai-ui-heuristicsSkill
- calm-technology-uiSkill
- conversion-growth-designSkill
- cross-platform-designSkill
- data-visualizationSkill
- design-systemsSkill
- design-thinking-processSkill
- error-empty-statesSkill
- ethical-design-patternsSkill
- form-uxSkill
- information-architectureSkill
- interaction-design-patternsSkill
- internationalization-uiSkill
- mobile-touch-designSkill
- modal-classes-lifecycleSkill
- modal-container-imagesSkill
- modal-dicts-queuesSkill
- modal-endpointsSkill
- modal-fundamentalsSkill
- modal-gpu-computeSkill
- modal-networkingSkill
- modal-observabilitySkill
- modal-parallel-executionSkill
- modal-sandboxesSkill
- modal-scaling-performanceSkill
- modal-schedulingSkill
- modal-secretsSkill
- modal-serversSkill
- modal-storageSkill
- modal-web-servingSkill
- modal-workspace-adminSkill
- motion-design-principlesSkill
- notifications-permissionsSkill
- onboarding-uxSkill
- rust-api-designSkill
- rust-async-programmingSkill
- rust-cargo-masterySkill
- rust-cli-applicationsSkill
- rust-clippy-lintsSkill
- rust-closures-iteratorsSkill
- rust-compiler-internalsSkill
- rust-concurrencySkill
- rust-design-patternsSkill
- rust-editionsSkill
- rust-embeddedSkill
- rust-error-handlingSkill
- rust-game-developmentSkill
- rust-lifetimes-borrowingSkill
- rust-macrosSkill
- rust-performanceSkill
- rust-rustdocSkill
- rust-rustup-toolchainSkill
- rust-smart-pointersSkill
- rust-testing-benchmarkingSkill
- rust-type-systemSkill
- rust-unsafe-ffiSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

