Preview brand Custom

Theme builder

Pick a brand colour, a base colour and two typefaces. Somnia DS builds a light and a dark theme, fixes anything that fails contrast, and gives you the tokens.

Beta

Colours
Page colour (light)

The brand colour is for actions and links. The base colour tints the pages and text, unless you choose a page colour of your own (it needs to be light).

Typefaces
Start from

Preview

A theme of your own

Every colour here was generated, then checked for contrast.

Enter an email address, like name@company.com.

Read how we built it.

A theme of your own

Every colour here was generated, then checked for contrast.

Enter an email address, like name@company.com.

Read how we built it.

Use it

Preview your theme on every page of these docs: it becomes the "Custom" choice in the Preview brand switch for this browser tab, and later changes here update it straight away. Or take the tokens: drop the JSON into tokens/brands/ and run the build.

Contrast

ThemePairingColoursRatio

How it works

  • Colours are worked out in OKLCH, a colour space where equal steps of lightness look equal, so pages, text and borders are all tinted with the base colour's hue.
  • Every text colour is checked against the surfaces it sits on. If a pairing fails, the colour is lightened or darkened, keeping its hue, until it passes: 4.5:1 for text, 3:1 for the focus ring.
  • Your brand colour is kept exactly where it passes. If it's too light for a light page (yellows and golds usually are), a deeper shade is used for links and buttons, and the notes above say so.
  • The output is the same set of semantic tokens a hand-made brand file sets, so it drops straight into Somnia DS.