Separate your surfaces
For this palette, start at #09090b and use lighter surfaces for cards and overlays. Test the actual contrast; no single background color guarantees readability.
StyleKit · Dark interface spec & prompts
A dark mode UI prompt tells an AI coding tool what to build, which dark surfaces and text colors to use, and how the interface should behave. Start with the copy-ready prompt below, replace the page type and audience, then use the Tailwind CSS v4 setup and contrast checks to review the generated UI.
Build a responsive dark-mode [page type] for [audience] with React and Tailwind CSS v4. Use #09090b for the page, #131316 for cards, and #1a1a20 for raised surfaces. Start with #fafafa primary text and #a1a1aa secondary text, then verify contrast against each actual background. Require at least 4.5:1 for normal text and 3:1 for large text. Define hover, focus, disabled, loading, empty, and error states. Support keyboard navigation, reduced motion, and a light/dark/system theme preference. Use CSS design tokens and @custom-variant for manual dark mode. Return the component, theme CSS, and a short verification checklist; do not claim accessibility compliance without testing.
Replace the bracketed page type and audience before using this in your AI coding tool.
Light UIs express elevation with shadows. On dark canvases shadows are nearly invisible, so lightness does the job — the closer a surface sits to the user, the lighter it gets. Select a layer to read its value and role.
sectionCard
#131316
Resting cards and panels. One step lighter than base, separated by a 1px border, not shadow.
Rule: each step is ~3-4% lighter than the one below, separated by a 1px low-contrast border. Five layers cover any interface.
Write these four into any prompt and AI-generated dark UIs jump a quality tier. Each rule ships with its proof.
sectionFor this palette, start at #09090b and use lighter surfaces for cards and overlays. Test the actual contrast; no single background color guarantees readability.
Saturated light-theme colors vibrate against dark canvases. Shift text and icons one step lighter — blue-500 becomes blue-400 — and keep 500 for solid fills only.
On the #09090b base, #fafafa primary text, #d4d4d8 body text, and #a1a1aa captions all exceed the 7:1 AAA text threshold. Recheck these tokens when the background changes.
This example reserves its accent for the primary action, active states, and meaningful data. Use additional colors when they carry information, not to fill every surface.
Every ratio below is computed with the WCAG relative-luminance formula. Use the table as a starting point, then test the generated UI rather than assuming the prompt guarantees accessibility.
section| Aa | FG / BG | Ratio | WCAG |
|---|---|---|---|
| Aa | #fafafa / #09090b | 19.06 | AAA |
| Aa | #d4d4d8 / #131316 | 12.55 | AAA |
| Aa | #60a5fa / #09090b | 7.83 | AAA |
| Aa | #a1a1aa / #09090b | 7.76 | AAA |
| Aa | #a1a1aa / #131316 | 7.24 | AAA |
| Aa | #3b82f6 / #09090b | 5.41 | AA |
| Aa | #71717a / #09090b | 4.12 | AA-LG |
| Aa | #52525b / #09090b | 2.57 | FAIL |
Each one carries concrete hex values, elevation steps, and contrast constraints — dashboards, SaaS, mobile, auth, pricing. Expand to read, copy, and paste straight into ChatGPT, Claude, Cursor, or v0.
sectionDesign a dark mode analytics dashboard. Background colors: #0a0a0a for base, #141414 for cards, #1e1e1e for elevated elements. Text: #f5f5f5 for primary, #a3a3a3 for secondary. Use a single accent color (blue #3b82f6) for interactive elements and data highlights. Cards should have subtle 1px borders in #262626. Charts should use the accent color with varying opacity for data series. Ensure all text meets WCAG AA contrast standards.
Straight from StyleKit's dark-mode style definition. When a generation drifts, paste the violated line back to the AI.
sectionDo
Don't
Runnable dark templates and related styles — every style page ships full tokens, component recipes, and exportable AI rules.
sectionBy default, dark: follows the system preference. To control it with a .dark class on html, add this to your CSS entry, then use utilities such as bg-white dark:bg-zinc-950. Your theme toggle must synchronize the class and the user's preference.
@import "tailwindcss";
/* Enable dark:* utilities when .dark is on <html>. */
@custom-variant dark (&:where(.dark, .dark *));
:root { color-scheme: light; }
.dark { color-scheme: dark; }Technical references checked:
Tailwind v4 uses a CSS custom variant for a manual theme selector; the default follows the system preference.
Normal text needs 4.5:1 contrast; large text needs 3:1. These are text-contrast requirements, not a full accessibility certification.
Starter templates
Related dark styles
Dark mode UI design uses dark surfaces, lighter text, and deliberately chosen accent colors. It is not simply an inverted light theme: each surface, text color, focus indicator, and interaction state needs to remain distinguishable. WCAG 2.2 requires at least 4.5:1 contrast for normal text and 3:1 for large text, with defined exceptions.
Tailwind CSS v4 uses the dark: variant and follows prefers-color-scheme by default. For a manual class toggle, add @custom-variant dark (&:where(.dark, .dark *)); after @import "tailwindcss"; in your CSS, then toggle the dark class on the html element. Use CSS custom properties for semantic theme colors, and preserve a light, dark, or system preference. Tailwind v3 configuration examples are not the CSS-first v4 setup.
Specify the page type, audience, layout, surface and text tokens, accent color, and responsive behavior. Ask for hover, focus, disabled, loading, empty, and error states, plus keyboard navigation and a theme preference. Require contrast checks against each rendered background and ask the tool to return both code and a verification checklist. Replace bracketed placeholders before using the starter prompt.
Common mistakes include inverting colors without checking the result, making secondary text too faint, relying only on color for errors, omitting focus states, and ignoring the saved theme preference. Pure black and fully opaque white are not automatically accessibility failures. Evaluate the actual foreground/background pairs and reading context instead of applying a universal opacity rule.
Choose the initial theme based on the intended audience, content, and environment, then verify both supported themes. Semantic CSS variables make shared components easier to adapt. StyleKit exports are implementation starting points; verify the selected style and your project's light and dark states instead of assuming every export supplies a complete dual-mode system.
This example uses #09090b for the base, #131316 for cards, and #1a1a20 for raised surfaces. These are design choices, not WCAG-mandated colors. Distinguish layers with lightness, borders, and spacing, then verify text and control contrast on each actual surface. There is no universal saturation reduction or background shade that makes every dark interface accessible.
WCAG 2.2 SC 1.4.3 requires at least 4.5:1 contrast for normal text and 3:1 for large text. Large text means at least 18pt (24 CSS px), or 14pt (about 18.67 CSS px) when bold. Check the final foreground and background colors, including transparency; do not round a failing ratio up to a pass. Text contrast alone does not establish full WCAG compliance: also test keyboard access, focus, labels, and state information.
Need a different direction? Browse all 148 design styles, or head back to the prompt library.
Explore StyleKit's other AI prompt libraries across interface types and stacks.