Good dark mode website design uses a very dark grey rather than pure black, off-white text rather than pure white, slightly desaturated accent colours, and surfaces that get lighter as they rise instead of casting shadows. Keep text contrast at or above the WCAG minimum of 4.5 to 1, test images and logos on dark backgrounds, and let visitors follow their device setting.
Why it exists
What dark mode is for, and what it is not
Dark mode is a colour scheme with light text on a dark background. People choose it for comfort in dim rooms, for battery savings on some screens and sometimes simply because they prefer it. Browsers and operating systems expose the choice, and a website can read it through a standard setting called prefers-color-scheme.
It is not a gimmick, and it is not accessibility on its own. Some people with light sensitivity find dark themes more comfortable, while some people with astigmatism find light text on a dark background harder to read. That is the argument for offering both and respecting the visitor's choice rather than forcing one.
The point of dark mode design is to keep the site pleasant and legible when the room is dark. Everything below follows from that.
Colour
The palette rules that matter most
Most dark themes fail on colour, not layout.
Background
Dark grey, not pure black
Pure black next to bright text creates a glare effect and makes smearing visible on some screens. A very dark grey or tinted near-black feels calmer and gives you room to show depth.
Text
Off-white, not pure white
Large areas of pure white text on dark can feel harsh. A slightly softened white keeps contrast high while reducing strain. Use lighter greys for secondary text but keep them above 4.5 to 1.
Accent
Slightly softer accents
Highly saturated colours vibrate against dark backgrounds. Lighten and desaturate your accent a little, and test it as link text, button fill and focus ring.
Depth
Lighter means higher
Shadows are hard to see on dark surfaces. Raise cards and menus by making them slightly lighter than the background, in small, consistent steps.
State
Success, warning and error colours
The reds, greens and ambers that work on white often look neon on dark. Define a second set tuned for dark and check each against its background.
The build
How to design a dark theme from scratch
Treat it as its own design, not an afterthought.
Define colour roles, not colour values.
Name colours by purpose: background, surface, text, muted text, border, accent. You then assign a light value and a dark value to each role, and every component reads the role.
Choose the base background and text.
Pick a deep, slightly tinted grey and an off-white. Measure the contrast between them and confirm it comfortably exceeds 4.5 to 1.
Set elevation steps.
Choose three or four surface lightnesses for the page, cards, raised menus and overlays. Keep the differences small and consistent.
Tune the accent and state colours.
Adjust the accent until links, buttons and focus outlines are clear on every surface. Do the same for error and success states.
Handle images and graphics.
Check photos, screenshots, logos and diagrams. Provide a dark-friendly logo variant if yours has a white box or dark text on transparency.
Test with real content.
Read an actual article, fill a form, hover every control and tab through the page. Test on a phone in a dim room, which is exactly where people use it.
Images and media
Photos, logos and diagrams in the dark
Photographs usually survive a dark page well, but very bright images can glare against a dark surround. Rounded corners, a thin low-contrast border or slightly reduced brightness for decorative images help them sit comfortably. Do not alter the brightness of work you are presenting as evidence, such as a photographer's portfolio, since changing it changes the work.
Logos and transparent PNGs cause the most surprises. A black wordmark on a transparent background vanishes on a dark page, and a logo with a white rectangle looks like a sticker. Keep a light version of your logo, or use a vector file that can take its colour from the current text colour.
Diagrams and charts need their own pass. Thin grey gridlines that were clear on white may disappear, and a palette of pastel categories can lose distinction. Use a limited number of well-separated colours and add labels so meaning does not rely on colour alone.
Accessibility
Contrast, focus and the visitor's choice
Accessibility guidelines apply in dark mode exactly as they do in light. Normal text needs a contrast ratio of at least 4.5 to 1 against its background, and large text and interface boundaries need at least 3 to 1. Measure with a contrast checker; do not trust your eyes on your own monitor.
Make focus visible. A keyboard focus ring that is a pale outline in light mode may be invisible on a dark surface, or the reverse. Test tabbing through the whole page in dark mode, including the menu and forms.
Start from the visitor's system setting. If their device says dark, show dark; if it says light, show light. A manual toggle is useful as an override, but it should not replace the default.
Finally, avoid relying on colour alone to show state. A red border on an error field should be accompanied by text, since colour differences become harder to judge at lower brightness.
In practice
Dark mode on a portfolio or business site
For a portfolio, dark often flatters visual work such as photography, film and motion, where the image is the point. For writing, consulting or engineering, check readability over long paragraphs and consider a slightly warmer off-white for text.
For a business website, remember that many customers look at your site on a phone in the evening, perhaps checking opening hours or finding your address. A dark mode that keeps your phone number, hours and map clearly legible is more valuable than one that merely looks good.
Every Folio design supports light and dark modes, so you do not need to build a second theme. Your task is to check your own photos, logos and graphics in both, which takes a few minutes and catches nearly every problem.
Frequently asked questions
Should my website have dark mode?
If you can support it properly, yes. Visitors increasingly set their device to dark, and a site that respects that feels considerate. If you cannot test it thoroughly, a well-built light theme is better than a rushed dark one.
Is pure black a good background for dark mode?
Usually not. Pure black with bright text creates strong glare and removes room for depth. A very dark grey, sometimes with a slight tint, is easier to read and gives you more design options.
What contrast ratio do I need in dark mode?
The same as light mode. WCAG asks for at least 4.5 to 1 for normal text and 3 to 1 for large text and interface components. Measure the actual colour pairs with a contrast checker.
Is dark mode better for eyes?
It depends on the person and the lighting. Many find it more comfortable in a dim room, while others read better on light backgrounds. Offering both and following the system setting is the safest approach.
Does dark mode affect SEO?
Not directly. Search engines read your content and structure, not your colour scheme. However, a comfortable, readable site can improve engagement, which supports the things search engines do care about.
How do I handle my logo in dark mode?
Use a vector logo that can take the text colour, or keep a light variant for dark backgrounds. Avoid logos with opaque white boxes, and test the header on both modes.