dark-mode-testing — Claude Code skill: dark theme checks
Toggles light and dark mode in the browser, screenshots both states, and points out hardcoded colors, invisible text and contrast failures.
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a claude-codeWhat dark-mode-testing does
The skill walks through a browser check of dark mode. It opens the target page, takes a screenshot in the default light state, then switches the theme and captures a second one. The toggle is tried in order: adding the dark class to <html>, setting data-theme="dark", emulating prefers-color-scheme: dark, and finally clicking the theme button found in the page snapshot.
After that the agent reads the screenshots and the aria tree and looks for the usual breakage: white flashes from hardcoded bg-white, text that matches the dark background, borders that vanish, shadows you cannot see, logos with no dark variant, and inputs that stay white. Contrast gets checked too, against a 4.5:1 threshold.
The output is a short report listing each spot with a suggested fix, like swapping border-gray-200 for dark:border-gray-700. Then you patch and re-run. Everything runs through browser tooling, so the app has to be up and reachable, and you need a browser MCP server or Cursor's built-in browser — without one the screenshot and toggle steps have nothing to drive.
What it helps with
- screenshot a page in both light and dark mode
- find text that blends into the dark background
- catch hardcoded colors such as
#ffffffandwhite - check text contrast against the 4.5:1 threshold
- produce a report of problem spots with ready fixes
Example prompts for the agent
- check dark mode on the landing page and show me what breaks
- screenshot light and dark mode and flag low contrast
- run dark-mode-testing on the settings page and suggest fixes
How to install dark-mode-testing
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a claude-code2Manually: put the files in place
~/.claude/skills/dark-mode-testing/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/dark-mode-testing/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a codex2Manually: put the files in place
.agents/skills/dark-mode-testing/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a cursor2Manually: put the files in place
.cursor/skills/dark-mode-testing/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills dark-mode-testing2Manually: put the files in place
.github/skills/dark-mode-testing/SKILL.md1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a gemini-cli2Platform CLI
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/dark-mode-testingManually: put the files in place
.devin/skills/dark-mode-testing/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about dark-mode-testing
How do I install dark-mode-testing in Claude?
Run npx skills add spencerpauly/awesome-cursor-skills --skill dark-mode-testing -a claude-code. The skill lands in ~/.claude/skills/dark-mode-testing/SKILL.md.
What does dark-mode-testing do?
It opens a page, screenshots it in light and dark mode, and lists the issues it finds: invisible text, missing borders, hardcoded colors, low contrast.
What does the skill need to run?
Browser tooling. It relies on navigation, screenshots and page snapshots, so the app must be running and reachable from the browser.
Source text
SKILL.md · CC0-1.0
---
name: dark-mode-testing
description: Toggle between light and dark mode in Cursor's browser, screenshot both states, and flag missing token mappings or contrast issues.
user-invocable: true
---
# Dark Mode Testing
Verify that dark mode works correctly by toggling themes and comparing.
## Workflow
### 1. Open the App
Navigate to the target page using `browser_navigate`.
### 2. Screenshot Light Mode
Take a screenshot of the page in its default (light) state using `browser_take_screenshot`.
### 3. Toggle Dark Mode
Toggle dark mode using one of these methods (try in order):
1. **Class toggle**: Execute JS to add `dark` class to `<html>`:
```javascript
document.documentElement.classList.toggle('dark')
```
2. **Attribute toggle**: Set `data-theme="dark"`:
```javascript
document.documentElement.setAttribute('data-theme', 'dark')
```
3. **Media query**: Use browser to emulate `prefers-color-scheme: dark`
4. **UI toggle**: Find the theme toggle button in `browser_snapshot` and click it
### 4. Screenshot Dark Mode
Take another screenshot after toggling.
### 5. Inspect for Issues
Check the `browser_snapshot` aria tree and screenshots for:
- **White flashes**: Elements with hardcoded `bg-white` instead of `bg-white dark:bg-slate-900`
- **Invisible text**: Text color that matches the dark background (e.g. black text on dark bg)
- **Missing borders**: Borders using light-only colors that disappear on dark backgrounds
- **Contrast violations**: Text that's too low-contrast against the dark background (need 4.5:1)
- **Hardcoded colors**: Any `#ffffff`, `#000000`, `white`, `black` in inline styles
- **Images**: Logos or icons that don't have dark mode variants
- **Shadows**: Box shadows that are invisible on dark backgrounds
- **Form inputs**: Input fields that keep white backgrounds in dark mode
### 6. Report
```
Dark Mode Test:
Light mode: OK
Dark mode issues found:
- Header logo: white logo invisible on dark bg (needs dark variant)
- Card borders: border-gray-200 invisible on dark bg → add dark:border-gray-700
- Footer text: hardcoded #333 → use text-gray-900 dark:text-gray-100
```
Fix each issue and re-test.
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills