Best For
dark mode / dark theme / night mode
暗黑模式
Rate this styleElegant dark interface design with low-contrast layering, subtle borders and highlights. Ideal for developer tools, professional applications, and night reading mode.
Best For
dark mode / dark theme / night mode
Primary Move
Use dark backgrounds bg-slate-900, bg-gray-900, bg-[#0f172a]
Watch Out
Do not use pure white text text-white (too harsh)
design.md
One document describes the colour roles, type rules, spacing and component construction behind this style. Copy or download it into Claude Code or Codex.
One blue on a slate ground, where inner glow rather than cast shadow explains depth.
Theme: dark
Dark Mode is not white inverted; it rebuilds a luminance order. The base is #0f172a — never pure black, because pure black kills shadow — and each level above lifts only four to six percent, at most three levels. Borders are 1px white at 6% to 10%, and they divide regions instead of shadows. All glow points inward: a button carries an inset white highlight along its top edge, modelling light coming from the screen itself, which is what actually happens on a dark surface. One blue carries emphasis; green, orange and red appear only as states.
| Name | Value | Token | Role |
|---|---|---|---|
| Deep Slate | #0f172a | --color-deep-slate | The page base and the deepest layer. Using it instead of black gives shadows somewhere to land. |
| Slate 800 | #1e293b | --color-slate-800 | Cards and panels, four percent above the base — the main carrying layer. |
| Slate 700 | #334155 | --color-slate-700 | Overlays and hover states, the third and final level. |
| Primary Blue | #3b82f6 | --color-primary-blue | Primary actions, links and selection; on dark it needs one step more brightness to read. |
| State Green | #22c55e | --color-state-green | Success and presence, rendered as 15% ground with solid text. |
| State Amber | #f59e0b | --color-state-amber | Warnings and pending items, on icons and badges only. |
| State Red | #ef4444 | --color-state-red | Errors and deletion; its presence implies cost. |
| Role | Family | Weight | Size | Line Height | Letter Spacing | Token |
|---|---|---|---|---|---|---|
| display | — | 700 | 60px | 1.1 | -0.02em | --text-display |
| heading-lg | — | 700 | 40px | 1.15 | -0.015em | --text-heading-lg |
| heading | — | 600 | 30px | 1.2 | — | --text-heading |
| subheading | — | 600 | 20px | 1.35 | — | --text-subheading |
| body-lg | — | 400 | 16px | 1.6 | — | --text-body-lg |
| body | — | 400 | 14px | 1.6 | — | --text-body |
| label | — | 500 | 12px | 1.4 | 0.04em | --text-label |
Base unit: 8px Density: comfortable
| Name | Value | Token |
|---|---|---|
| 8 | 8px | --spacing-8 |
| 16 | 16px | --spacing-16 |
| 24 | 24px | --spacing-24 |
| 32 | 32px | --spacing-32 |
| 48 | 48px | --spacing-48 |
| 64 | 64px | --spacing-64 |
| 96 | 96px | --spacing-96 |
| Element | Value |
|---|---|
| cards | 12px |
| buttons | 8px |
| inputs | 8px |
| badges | 999px |
Role: Primary action
Primary blue fill, white text, 8px radius, no border. 14px type at weight 500, 8px 16px padding. The key is the inset top highlight — inset 0 1px 0 at 15% white — modelling light from the screen itself. Hover brightens the fill and adds a 0 0 10px glow at 30% blue; press scales 0.98 and swaps to inset 0 2px 4px at 30% black. 200ms ease-out.
Role: Content card and list container
Slate 800 at 50% fill, a 1px slate 700 border, 12px radius, 24px padding, no shadow — shadows barely register on dark, so the border does the layering. Hover takes the fill to full opacity, the border to slate 500, lifts 2px and adds 0 8px 30px at 50% black. 300ms ease-out.
Role: Forms and search
Slate 800 fill, a 1px slate 700 border, 8px radius, 8px 12px padding at 14px. The placeholder sits in slate 400. Focus turns the border primary blue and adds a 2px ring at 30% blue, with the offset painted in deep slate so no white edge appears.
Role: Status and category markers
Fully rounded, 12px type at weight 500, 2px 10px padding. Success uses a 15% green ground with green 400 text, warning 15% amber, error 15% red. Each carries a dot so status never rests on hue alone.
| Level | Name | Value | Purpose |
|---|---|---|---|
| 0 | Deep Slate | #0f172a | 页面底 |
| 1 | Slate 800 | #1e293b | 卡片与面板 |
| 2 | Slate 700 | #334155 | 浮层与 hover |
none — 1px border carries it0 8px 30px rgba(0,0,0,0.50)inset 0 1px 0 rgba(255,255,255,0.15)Product interface shots and dark-scene photography. A very dark radial glow may back the hero. Every asset must already be dark so the highlights belong to the interface. No white-background images, color illustration or large flat blocks.
Capped at 1200px over twelve columns with 24px padding, sections 96px apart. Sections divide with a 1px white line at 6% rather than a shadow. A rail may sit beside the content, but the two must differ by at least one luminance level.
QUICK COLOR REFERENCE:
#e2e8f0#0f172a#1e293b#3b82f6#94a3b8rgba(255,255,255,0.08)EXAMPLE COMPONENT PROMPTS:
:root {
/* Colors */
--color-deep-slate: #0f172a;
--color-slate-800: #1e293b;
--color-slate-700: #334155;
--color-primary-blue: #3b82f6;
--color-state-green: #22c55e;
--color-state-amber: #f59e0b;
--color-state-red: #ef4444;
/* Typography — Font Families */
--font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
/* Typography — Scale */
--text-display: 60px;
--leading-display: 1.1;
--tracking-display: -0.02em;
--text-heading-lg: 40px;
--leading-heading-lg: 1.15;
--tracking-heading-lg: -0.015em;
--text-heading: 30px;
--leading-heading: 1.2;
--text-subheading: 20px;
--leading-subheading: 1.35;
--text-body-lg: 16px;
--leading-body-lg: 1.6;
--text-body: 14px;
--leading-body: 1.6;
--text-label: 12px;
--leading-label: 1.4;
--tracking-label: 0.04em;
/* Typography — Weights */
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
/* Spacing */
--spacing-unit: 8px;
--spacing-8: 8px;
--spacing-16: 16px;
--spacing-24: 24px;
--spacing-32: 32px;
--spacing-48: 48px;
--spacing-64: 64px;
--spacing-96: 96px;
/* Layout */
--page-max-width: 1200px;
--section-gap: 96px;
--card-padding: 24px;
--element-gap: 16px;
--density: comfortable;
/* Border Radius */
--radius-cards: 12px;
--radius-buttons: 8px;
--radius-inputs: 8px;
--radius-badges: 999px;
/* Surfaces */
--surface-deep-slate: #0f172a;
--surface-slate-800: #1e293b;
--surface-slate-700: #334155;
}
Component Templates
FAQ
/* Dark Mode Global Styles */
@layer base {
body {
@apply bg-slate-900 text-slate-100 antialiased;
}
h1, h2, h3, h4 {
@apply font-semibold text-slate-100;
}
::selection {
@apply bg-blue-600 text-white;
}
}
/* Subtle glow for focus states */
.dark-focus-glow:focus {
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}
/* Dark Mode Design Tokens */
:root {
--dark-mode-primary: #3b82f6;
--dark-mode-secondary: #0f172a;
--dark-mode-accent: #22c55e;
--dark-mode-glow: rgba(59, 130, 246, 0.3);
}
@keyframes dark-mode-fade-in {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes dark-mode-pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.dark-mode-card {
position: relative;
overflow: hidden;
}
.dark-mode-card::before {
content: "";
position: absolute;
inset: 0;
opacity: 0;
transition: opacity 0.3s ease;
background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), transparent);
pointer-events: none;
}
.dark-mode-card:hover::before {
opacity: 1;
}
.dark-mode-gradient {
background: linear-gradient(135deg, #3b82f6, #22c55e);
}
.dark-mode-gradient-text {
background: linear-gradient(135deg, #3b82f6, #22c55e);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.dark-mode-frosted {
backdrop-filter: blur(12px) saturate(180%);
-webkit-backdrop-filter: blur(12px) saturate(180%);
background: rgba(59, 130, 246, 0.08);
}
.dark-mode-accent-corner {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2rem), calc(100% - 2rem) 100%, 0 100%);
}
.dark-mode-animate-in {
animation: dark-mode-fade-in 0.5s ease-out both;
}Compatible Layout Patterns
The following layout patterns pair well with the Dark Mode style.
Related Styles
Explore these styles for ready-made tokens and components.
Dark Mode and Asymmetric Grid sit closest to each other. The table below gives the real differences in color, use case, and tags, so the choice between them is made on facts.
| Attribute | Dark Mode | Asymmetric Grid |
|---|---|---|
| Primary color | #3b82f6 | #0f0f0f |
| Secondary color | #0f172a | #ffffff |
| Best for | dark mode / dark theme / night mode | asymmetric grid / broken grid layout / asymmetrical layout |
| Unique tags | — | high-contrast |
Dark Mode design emphasizes creating a comfortable reading experience and clear information hierarchy on dark backgrounds.