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.
Preview
Enter an email address, like name@company.com.
Read how we built it.
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
| Theme | Pairing | Colours | Ratio |
|---|
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.