Skip to main content

Dark mode

The Dark mode screen in the panel, with the switch and the two background colors

More → Dark mode turns on a second, dark version of your site's colors. It is off by default — turning it on is a choice you make, never something that changes your site's look on its own after an update.

What changes, and what never does​

Only the colors by function get a dark value: the page background, raised surfaces, body text, headings, borders, shadows, the brand color used as a link, and the keyboard focus ring.

Your brand color itself, and every one of its calculated tones, never change. Neither does any other fixed color. That is on purpose: a section you designed dark yourself — a dark hero, a colored band — stays exactly as dark as you made it. A framework that inverted those too would turn your intentionally dark sections light, which is not what dark mode is for.

Make your design follow it​

Dark mode only reaches what is built with the variables by function. If a card's background is var(--white) and its title is var(--heading-color), the title turns light in dark mode while the card stays white, and the text disappears. Use the function variable for anything that should follow the theme:

ForUseNot
Page and section backgrounds--bg-body--white
Raised surfaces: cards, panels, alternate sections--bg-surface--base-ultra-light
Body text--text-color--base, --base-dark
Headings--heading-color--base-ultra-dark, --black
Lines and borders--border-color--base-light
The brand color as text (links, small labels)--link-color--primary, --primary-dark

Keep a fixed color only where both sides are fixed on purpose: a yellow badge with dark text, a dark hero you designed dark. There, set the text color fixed too (for example --base-ultra-dark on a --secondary background), or it will follow the theme while its background does not.

A light screenshot or image on a dark page can show its own light edge as a thin white line: crop the image a couple of pixels inside its frame.

Turning it on​

  1. Turn on the switch in More → Dark mode and apply, same as any other change.
  2. Choose how a visitor ends up seeing it:
    • Automatic — follows the visitor's own system setting. A switch of your own (next) can still force either side regardless of the system.
    • Only with a switch — the system is ignored; nothing is dark until your own switch says so.

Dark mode has no live preview on the page itself — apply it, then switch your system or your own switch to see it, the same way the base CSS's optional modules work.

The switch itself​

On a Bricks site, nothing more to do: Bricks has had its own dark mode since version 2.2 — a setting in its Style Manager and a native Toggle - Mode element with a sun/moon icon. Fancy Framework reads Bricks' own setting instead of adding a second one of its own, so the two never disagree. Drop Bricks' own toggle element wherever you want a switch.

Everywhere else (Etch today), the plugin does not add a button of its own — it never draws anything on your page. Instead, put the attribute data-ff-theme-toggle on any button you design yourself, anywhere on the page, and it becomes the switch: a tiny script remembers the visitor's choice and applies it before the page paints, so there is no flash of the wrong theme. If you ever remove the plugin, that button is still a normal button — it simply stops switching anything.

The two backgrounds, adjustable​

The page background and the raised-surface background in dark mode are calculated from your base color by default, with the same guaranteed contrast as the rest of the palette. Each has its own field if you want a different one instead — doing that gives up the calculated guarantee for that background, the same trade-off as overriding a tone in Colors.

The accessibility seal checks it too​

Once dark mode is on, the seal measures every contrast check that dark mode actually changes a second time, against the dark values — not just the light ones. A check dark mode leaves untouched is not repeated; one it does touch is reported again, named "…, in dark mode", right next to its light-mode twin.