dark-mode-css
What it does
This skill adds a dark version of a website's colours. It is for developers who want their site to look comfortable at night and respect device settings.
When to use it
- ✓When your visitors ask for a dark theme for reading at night.
- ✓When your site has fixed colours that look wrong on a dark background.
- ✓When you want the site to follow each visitor's light or dark device setting.
Skill link
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/dark-mode-css/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Can you add dark mode to my website that follows the system setting?”
5 new skills a week. 1 minute to read.
How it works
The agent moves colours into named values and sets different ones for dark mode. It can also add a switch so visitors can choose their own theme.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Support dark mode with prefers-color-scheme
More than half of users prefer dark mode for reduced eye strain, especially in low-light environments. Users with photosensitivity rely on it. Implementing dark mode via prefers-color-scheme respects the user's OS preference without them needing to find a toggle, and CSS custom properties make it a clean, maintainable addition rather than a disruptive refactor.
Quick Reference
- Use @media (prefers-color-scheme: dark) to apply dark mode styles
- Define light/dark colors as CSS custom properties on :root for easy switching
- Support a manual toggle by storing preference in localStorage and setting a data-theme attribute
- Ensure dark mode colors maintain WCAG contrast ratios
Check
Check if this CSS supports dark mode. Look for prefers-color-scheme usage or a data-theme attribute pattern. Identify any hard-coded colors that would look wrong in dark mode.
Fix
Implement dark mode by extracting colors to CSS custom properties and redefining them inside a prefers-color-scheme: dark media query.
Explain
Explain how to implement dark mode with CSS custom properties, the prefers-color-scheme media query, and a JavaScript toggle for user preference.
Code Review
Review stylesheets, component styles, and responsive states related to Support dark mode with prefers-color-scheme. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/css/dark-mode-css
FAQ
How does the site know the visitor wants dark mode?
The browser reports the device setting, and the page uses it to choose dark colours automatically.
Can visitors pick a theme themselves?
Yes. The skill describes a manual switch whose choice is saved in the browser.
Will text stay readable in dark mode?
The skill says to keep contrast high enough to meet accessibility standards for text.
Details
Original description by the author
Use when reviewing stylesheets, component styles, and responsive behavior related to Support dark mode with prefers-color-scheme. Check the rendered layout across breakpoints and interaction states before proposing a fix.
Popularity
- GitHub stars
- 75k
- Ranking position
- #2807
- License
- MIT
- Updated
- 10/31/2026
Comments
- …
More skills from this repository
frontendchecklist
75kChecks frontend code and live pages against 380+ rules for accessibility, speed, SEO and security, using a command-line tool.
frontend-checklist-global
75kAudits a frontend project against all 386 Front-End Checklist rules, and gives a specific fix for each issue found.
404-page
75kChecks that your missing-page screen offers helpful links and returns a real 404 status, to help lost visitors find their way.
about-page
75kReviews whether your site has a clear About page that explains who runs it, to build trust with visitors and search engines.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.