Dark Mode

Explore the characteristics and applications of the Dark Mode web design style

Back to Style List

See this style applied to a real page — identical content, different stylesheet.

Open live preview →

About This Style

Dark Mode, also known as dark theme or night mode, is an interface color scheme that uses dark backgrounds and light foregrounds (text, icons). It contrasts with the traditional light background, dark foreground approach.

The main goal of dark mode is to reduce the light emitted by screens, especially in low-light environments, thereby alleviating user eye strain. It is also often considered to have a more modern and elegant appearance.

Main Features:

Dark mode has become a standard option in many operating systems and applications, offering users flexibility based on environment or personal preference. Well-designed dark mode is not just about aesthetics, but also about accessibility and user comfort.

Sample AI Prompt

Create a modern dashboard UI in dark mode. Use a dark grey background (#1F2937), light grey text (#D1D5DB), bright blue accents (#60A5FA) for interactive elements, Inter font, and ensure sufficient contrast for readability.

(Chinese Explanation: Create a modern dashboard UI in dark mode. Use a dark grey background (#1F2937), light grey text (#D1D5DB), bright blue accents (#60A5FA) for interactive elements, Inter font, and ensure sufficient contrast for readability.)

Theme CSS Code Snippet

Below is the core CSS code for applying dark mode as a global theme (body.theme-dark-mode):

/* 1. Dark Mode Theme */
body.theme-dark-mode {
    --page-bg: #1f2937; /* Dark blue-grey */
    --page-bg-gradient: linear-gradient(to bottom, #374151, #1f2937);
    --text-color: #d1d5db; /* Light grey text */
    --heading-color: #f9fafb; /* Near white headings */
    --link-color: #60a5fa; /* Bright blue link */
    --link-hover-color: #93c5fd; /* Lighter blue hover */
    --border-color: #4b5563; /* Mid-grey border */
    --card-bg: #374151; /* Slightly lighter card bg */
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3); /* Darker shadow */
    --card-hover-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(31, 41, 55, 0.8); /* Semi-transparent header */
    --header-text-color: var(--heading-color);
    --header-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px); /* Optional: Blur effect */
    border-bottom: 1px solid var(--border-color);
    --footer-text-color: #9ca3af; /* Muted grey footer text */
    --footer-bg: #1f2937; /* Match page bottom */
    border-top: 1px solid var(--border-color);
    --button-bg: var(--link-color); /* Use link color for primary button */
    --button-text-color: #ffffff;
    --button-hover-bg: var(--link-hover-color);
    --button-border: none;
    --button-secondary-bg: #4b5563; /* Grey secondary button */
    --button-secondary-text-color: var(--text-color);
    --button-secondary-hover-bg: #6b7280;
    --button-secondary-border: none;
    --prompt-bg: #111827; /* Even darker prompt area */
    --prompt-text-color: #9ca3af; /* Muted prompt text */
    --base-font: var(--font-inter); /* Clean sans-serif like Inter */
    --heading-font: var(--font-inter);
    --card-border-radius: 8px; /* Standard border radius */
    --button-border-radius: 6px;
}
            

Note: Implementing good dark mode requires careful consideration of color contrast and saturation to ensure all elements are clear and not glaring on a dark background.

Resource Download (Example)

Download a zip file containing a more complete CSS definition for this style (may include specific component styles, font file references, etc.).

Download dark-mode.zip