Back to directory

Tailwind Syntax Dark Mode

Agent skill
1 skill

Use when adding, debugging, or migrating dark-mode support in a Tailwind project: choosing between the default prefers-color-scheme strategy and user-toggleable class or attribute strategies, wiring the JavaScript toggle, swapping CSS-variable token values for light vs dark, or porting v3 darkMode configuration to the v4 @custom-variant dark directive. Prevents the four canonical dark-mode failures: assuming dark: utilities need configuration before they work, leaving v3's darkMode: 'class' config in a v4 project (silently ignored), forgetting the v4 @custom-variant dark directive when migrating from v3 darkMode: 'class', and shipping a toggle that flashes the wrong theme on first paint because the script runs after CSS. Covers: default media strategy, class-based toggling (v3 darkMode: 'class' and 'selector', v4 @custom-variant dark (&:where(.dark, .dark ))), attribute-based toggling ([data-theme="dark"]), custom variant strategies, theme-token swap via CSS variables, and the canonical JavaScript toggle snippet using localStorage plus matchMedia. Always shows v3 and v4 in side-by-side blocks; never fuses a single snippet that hides the version difference (per D-008). Keywords: dark mode, dark variant, dark:bg-, dark:text-, prefers-color-scheme, darkMode class, darkMode selector, custom-variant dark, where dark class, data-theme dark, toggle dark mode, localStorage theme, matchMedia, next-themes, light dark system, color scheme, how do I add dark mode, dark mode not working, dark utilities ignored, flash of wrong theme, FOUC, flash of unstyled content, OS dark mode, system theme, v3 to v4 dark mode migration, darkMode config removed.

Install with
Claude CodeCodexCursorGitHub CopilotGemini CLI

Supported by the Atlas install prompt. Skill-specific requirements vary.

Skill stats

Skills1CategoryDeveloper toolsStars0

About this skill

Use when adding, debugging, or migrating dark-mode support in a Tailwind project: choosing between the default prefers-color-scheme strategy and user-toggleable class or attribute strategies, wiring the JavaScript toggle, swapping CSS-variable token values for light vs dark, or porting v3 darkMode configuration to the v4 @custom-variant dark directive. Prevents the four canonical dark-mode failures: assuming dark: utilities need configuration before they work, leaving v3's darkMode: 'class' config in a v4 project (silently ignored), forgetting the v4 @custom-variant dark directive when migrating from v3 darkMode: 'class', and shipping a toggle that flashes the wrong theme on first paint because the script runs after CSS. Covers: default media strategy, class-based toggling (v3 darkMode: 'class' and 'selector', v4 @custom-variant dark (&:where(.dark, .dark ))), attribute-based toggling ([data-theme="dark"]), custom variant strategies, theme-token swap via CSS variables, and the canonical JavaScript toggle snippet using localStorage plus matchMedia. Always shows v3 and v4 in side-by-side blocks; never fuses a single snippet that hides the version difference (per D-008). Keywords: dark mode, dark variant, dark:bg-, dark:text-, prefers-color-scheme, darkMode class, darkMode selector, custom-variant dark, where dark class, data-theme dark, toggle dark mode, localStorage theme, matchMedia, next-themes, light dark system, color scheme, how do I add dark mode, dark mode not working, dark utilities ignored, flash of wrong theme, FOUC, flash of unstyled content, OS dark mode, system theme, v3 to v4 dark mode migration, darkMode config removed.

Quick start

  1. Copy the install prompt. Use the green button above this README.
  2. Send it to your agent. Paste it into your coding agent’s chat and send.
  3. Review the setup. Your agent checks the skill’s instructions, requirements, and installation scope.
Review, license & listing details
Review the source before using this skill

This is an imported listing. We haven’t certified its safety, license, or compatibility. Skills may include executable scripts.

Automated security scan: Partial

Only SKILL.md was scanned. Supporting files and scripts were not checked. No safety grade has been assigned.

0 potential findings · Scanned 11/4/2026 · Scanner 0.2.1

Content SHA-256: 343d72afa16b1dcea492620325246120dce69f7ff81f227660c32f932581934b

About scan coverage and limitations

About this listing

Category
Developer tools
Reported license
MIT
Listing language (estimated)
English
Review status
Not individually reviewed
Agent compatibility
Atlas installation supports Claude Code, Codex, and Cursor. Skill-specific dependencies and features are checked during setup.
Tailwind Syntax Dark Mode | Agent Skills Atlas