StyleKit

Dark Mode

暗黑模式

Rate this style

Elegant dark interface design with low-contrast layering, subtle borders and highlights. Ideal for developer tools, professional applications, and night reading mode.

dark modedark themenight modedark ui designdeveloper tools uilow contrast layeringsubtle borderseye strain reductiondark dashboardprofessional dark interface

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

Dark Mode as a design document

One document describes the colour roles, type rules, spacing and component construction behind this style. Copy or download it into Claude Code or Codex.

Document view

Dark Mode — Style Reference

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.

Colors

NameValueTokenRole
Deep Slate#0f172a--color-deep-slateThe page base and the deepest layer. Using it instead of black gives shadows somewhere to land.
Slate 800#1e293b--color-slate-800Cards and panels, four percent above the base — the main carrying layer.
Slate 700#334155--color-slate-700Overlays and hover states, the third and final level.
Primary Blue#3b82f6--color-primary-bluePrimary actions, links and selection; on dark it needs one step more brightness to read.
State Green#22c55e--color-state-greenSuccess and presence, rendered as 15% ground with solid text.
State Amber#f59e0b--color-state-amberWarnings and pending items, on icons and badges only.
State Red#ef4444--color-state-redErrors and deletion; its presence implies cost.

Typography

Inter — The only face. On dark it needs looser leading (1.6) and a slightly lower maximum weight to avoid halation.
  • Substitute: system-ui, -apple-system, 'Segoe UI', sans-serif
  • Weights: 400, 500, 600, 700
  • Sizes: 12, 14, 16, 20, 30, 40, 60
  • Line height: 1.1 (display), 1.25 (headings), 1.6 (body)
  • Letter spacing: -0.02em on display, 0.04em on uppercase labels
Type Scale
RoleFamilyWeightSizeLine HeightLetter SpacingToken
display—70060px1.1-0.02em--text-display
heading-lg—70040px1.15-0.015em--text-heading-lg
heading—60030px1.2—--text-heading
subheading—60020px1.35—--text-subheading
body-lg—40016px1.6—--text-body-lg
body—40014px1.6—--text-body
label—50012px1.40.04em--text-label

Spacing & Layout

Base unit: 8px Density: comfortable

Spacing Scale
NameValueToken
88px--spacing-8
1616px--spacing-16
2424px--spacing-24
3232px--spacing-32
4848px--spacing-48
6464px--spacing-64
9696px--spacing-96
Border Radius
ElementValue
cards12px
buttons8px
inputs8px
badges999px
  • Page max-width: 1200px
  • Section gap: 96px
  • Card padding: 24px
  • Element gap: 16px

Components

Primary Button

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.

  • Sizes: padding 8px 16px; label 14px
  • States: hover: brighter fill + outer glow; active: inset shadow, scale 0.98
Surface Card

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.

  • States: hover: fill opaque, border lighter, lift 2px
Dark Input

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.

Status Chip

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.

Do's and Don'ts

Do
  • Ground in deep slate #0f172a, not pure black
  • Keep three luminance levels, four to six percent apart
  • Layer with 1px white borders at 6% to 10%
  • Buttons carry a top-edge inset highlight
  • Body leading at 1.6 and weight at 700 or below
  • Paint the focus offset in the ground color, not white
Don't
  • Never ground in pure black #000000
  • Do not rely on shadows for layering; they vanish on dark
  • Never use state colors as decoration
  • No body contrast below 4.5:1
  • Avoid pure white text; use 90% to 95%
  • No large bright blocks on a dark ground

Surfaces

LevelNameValuePurpose
0Deep Slate#0f172a页面底
1Slate 800#1e293b卡片与面板
2Slate 700#334155浮层与 hover

Elevation

  • Card: none — 1px border carries it
  • Card hover: 0 8px 30px rgba(0,0,0,0.50)
  • Inset glow: inset 0 1px 0 rgba(255,255,255,0.15)

Imagery

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.

Layout

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.

Agent Prompt Guide

Implementation Contract
  • Use the requested page, user task and real content as the brief. Implement only the requested scope; identify missing business information instead of inventing data or capabilities.
  • Inspect the current project, stack and components first. Reuse its structure, routes, dependencies and components; do not rebuild unrelated pages or features.
  • Use the project's breakpoints to adapt columns and spacing for narrow and desktop screens. Preserve hierarchy and prevent accidental horizontal overflow.
  • For interactions in scope, support keyboard focus and reduced motion, with applicable disabled, loading, empty and error states.
  • Run the project's existing checks after implementation. Report only tests and visual checks actually run, and list unverified behavior.

QUICK COLOR REFERENCE:

  • text: #e2e8f0
  • background: #0f172a
  • card: #1e293b
  • accent: #3b82f6
  • muted: #94a3b8
  • border: rgba(255,255,255,0.08)

EXAMPLE COMPONENT PROMPTS:

  1. Build a dark card: background #1e293b (50% opacity is fine), 1px rgba(255,255,255,0.08) border, 12px radius, 24px padding, no shadow. Title at 20px/600 in #e2e8f0, body at 14px in #94a3b8. Hover makes the fill opaque, raises the border to rgba(255,255,255,0.16), translates -2px and adds 0 8px 30px rgba(0,0,0,0.5). The page ground is #0f172a.

Similar Brands

  • macOS Vibrancy — Also layers on dark, though that one adds system material and serif titles
  • Linear — Same dark ground with one accent, though Linear leans harder on glow

Quick Start


: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;
}

Community

Ratings & Feedback

No ratings yet - be the firstSign in to rate

Loading comments…

Component Templates

Component Preview

Button

FAQ

Dark Mode — Frequently Asked Questions

What is the Dark Mode design style?
Elegant dark interface design with low-contrast layering, subtle borders and highlights. Ideal for developer tools, professional applications, and night reading mode. Its core principle: Dark Mode design emphasizes creating a comfortable reading experience and clear information hierarchy on dark backgrounds.
What colors does Dark Mode use?
Dark Mode uses #3b82f6 as its primary color and #0f172a as its secondary color, with accent colors #22c55e, #f59e0b, #ef4444, #2ab5e5. Every hex value can be copied from the palette on this page.
How do I apply Dark Mode correctly?
Key practices: Use dark backgrounds bg-slate-900, bg-gray-900, bg-[#0f172a]. Cards use slightly lighter backgrounds bg-slate-800/50, brighten on hover hover:bg-slate-800. Borders use low contrast border-slate-700, illuminate on hover hover:border-slate-500.
What are common mistakes with Dark Mode?
Avoid: Do not use pure white text text-white (too harsh). Do not use high-contrast borders. Do not use pure black background #000000 (too dull).
How do I prompt AI to generate Dark Mode UI?
Copy the ready-made AI prompt on this page — it bundles the design tokens and component rules — and paste it into ChatGPT, Claude, Claude Code, or Codex. Effective prompts include the keywords: dark mode, dark theme, night mode, dark ui design.
Global Styles

Global CSS

css
/* 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

Recommended Layouts

The following layout patterns pair well with the Dark Mode style.

Related Styles

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.

AttributeDark ModeAsymmetric Grid
Primary color#3b82f6#0f0f0f
Secondary color#0f172a#ffffff
Best fordark mode / dark theme / night modeasymmetric grid / broken grid layout / asymmetrical layout
Unique tags—high-contrast
Design Philosophy

Dark Mode design emphasizes creating a comfortable reading experience and clear information hierarchy on dark backgrounds.