Developer

Light & Dark Theme Previewer

Preview an accent color in light and dark themes side by side and copy the theme CSS.

Developer

Why Use the Light & Dark Theme Previewer?

Before you commit to an accent color, this light and dark theme previewer shows it in two complete mock interfaces placed side by side. Each mock includes a navigation bar, a card, body text and a button, and the dark version automatically uses a lightened accent so it stays vivid against a dark surface. The tool then writes CSS custom properties for both themes, switched with the prefers-color-scheme media query, giving developers a ready starting point for dark mode support.

How to Use the Light & Dark Theme Previewer

  1. Enter your accent color with the picker or type a HEX, rgb(), hsl() or CSS color name value into the text box.
  2. Compare the light and dark mock interfaces side by side, paying attention to the button, links and card edges in each.
  3. Notice how the accent is lightened in the dark theme, and adjust your base accent if either version looks too dull or too harsh.
  4. Click Copy on the CSS output and paste the custom properties into your stylesheet, then reference the variables in your components instead of hard-coded colors.

Best For

  • Checking that a brand accent works on both light and dark backgrounds before finalizing a style guide.
  • Adding system-based dark mode to a marketing site or blog using only CSS variables.
  • Showing stakeholders how a product interface will look for users who prefer dark mode.
  • Starting a theming setup for a web app that can later grow into a manual theme toggle.

Pro Tip

Add the declaration color-scheme: light dark to your root element alongside the generated variables, so browsers also switch built-in elements like form controls and scrollbars to match the active theme. Keep variable names based on purpose, such as surface, text and accent, rather than on color names, so the same name can hold a different value in each theme. If you later add a manual toggle, apply the dark values with a data attribute on the html element as well as inside the media query.

FAQ

Light & Dark Theme Previewer FAQ

How do I add dark mode to a website with CSS?

Define your colors as CSS custom properties on :root, then redefine the same properties inside a @media (prefers-color-scheme: dark) block. Components that use the variables switch automatically when the visitor has dark mode turned on. This requires no JavaScript unless you also want a manual toggle.

What is prefers-color-scheme?

prefers-color-scheme is a CSS media feature that reports whether the visitor has chosen a light or dark appearance in their operating system or browser. It returns light or dark, and you can write different styles for each. All current major browsers support it.

Why should accent colors be lighter in dark mode?

A saturated mid-tone color that looks strong on white often appears dim or vibrates uncomfortably against a dark background. Raising its lightness, and sometimes lowering its saturation slightly, restores contrast and keeps it comfortable to read. That is why this previewer lightens the accent for the dark theme.

Should dark mode use pure black backgrounds?

Most design systems use a very dark gray instead of pure black; Material Design, for example, recommends #121212. Dark gray reduces the harsh glow of bright text on black and leaves room to show elevation with slightly lighter surfaces. Pure black can still suit OLED-focused apps where saving power matters.

Learn more

Guides for the Light & Dark Theme Previewer

Choosing Colors That Work in Both Light and Dark Mode

Design one color system that adapts cleanly to light and dark themes using semantic tokens, tuned accents, and careful contrast.

Read Guide

How to Build a Dark Mode Palette That Still Feels Premium

Learn how to choose dark backgrounds, softened highlights, and readable accents without making your UI look muddy or flat.

Read Guide

Best Website Color Combinations (With HEX Codes You Can Copy)

12 of the best website color combinations with HEX codes you can copy, when to use each one, and how to adapt them to your brand while keeping text readable.

Read Guide
Copied