Theme
One stylesheet for all web applications of confirm IT:
- The corporate design colours
- A modern CSS reset
- Semantic design tokens with a dark & a light theme
- Typographic defaults with self-hosted fonts
This page is built with nothing but the theme itself.
Usage
Include the theme in the <head> of your application.
It already includes colours.css, so you don't need anything else.
<link rel="stylesheet" href="https://assets.confirm.ch/theme.css">
Dark is the default theme. Use the data-theme attribute to change it.
It works on any element, e.g. to render a light card inside a dark application – the panels on this page do exactly that.
| Markup | Theme |
|---|---|
<html> | Dark |
<html data-theme="light"> | Light |
<html data-theme="auto"> | Follows the operating system |
Try it on this page:
Always use the semantic --theme-* tokens instead of the raw --cd-* colours.
They switch automatically with the theme, and every text & background combination meets the WCAG AA contrast ratio (4.5:1) in both themes.
Surfaces & text
Four tokens build the layers of an interface:
--theme-backgroundfor the page itself--theme-surfacefor cards & panels--theme-surface-raisedwith--theme-shadowfor popovers & dialogs--theme-borderto separate them
Body text in --theme-text.
Secondary text in --theme-text-muted.
--theme-surface.--theme-surface-raised.Primary & accent
The brand colours, for actions & highlights:
--theme-primaryis the orange of our logo, identical in both themes, for fills such as buttons--theme-primary-contrastfor text on top of it--theme-primary-textfor orange text on the background, e.g. links, as it stays readable on light backgrounds--theme-accentcomplements it for secondary actions and marks the keyboard focus
Text with a link in --theme-link and some primary text.
Status colours
Each status comes with four tokens: a fill (e.g. badges) with its *-contrast text colour, a *-text colour for text & icons on the background, and a *-subtle tint for alerts.
| Token | Usage |
|---|---|
--theme-error | Fills, e.g. badges |
--theme-error-contrast | Text on the fill |
--theme-error-text | Text & icons on the background |
--theme-error-subtle | Tinted backgrounds, e.g. alerts |
Typography
Texts are set in Poppins, code in Roboto Mono.
Both are self-hosted and loaded by the theme, so no external font service is involved.
--theme-font-size-3xlHeading 1
--theme-font-size-2xlHeading 2
--theme-font-size-xlHeading 3
--theme-font-size-lgHeading 4
--theme-font-sizeBody text, headings 5 & 6
--theme-font-size-smSmall text
--theme-font-weight-lightLight 300
--theme-font-weight-regularRegular 400
--theme-font-weight-mediumMedium 500
--theme-font-weight-semiboldSemibold 600 – headings & strong
--theme-font-weight-boldBold 700
Spacing, radii & shadows
--theme-space-xs
--theme-space-sm
--theme-space
--theme-space-lg
--theme-space-xl
--theme-space-2xl
--theme-radius-sm--theme-radius--theme-radius-lg--theme-radius-round--theme-shadowElements
Plain HTML elements are styled out of the box, without any classes.
Heading
A paragraph with a link, strong & small text, marked text, inline code and a shortcut ⌘ K.
A blockquote with the brand stripe.
const theme = 'confirm';
| Name | Status |
|---|---|
| Build | passed |
| Deploy | running |
Overriding
The whole theme lives in the confirm cascade layer.
Styles outside of a layer always win over layered styles, regardless of their specificity.
So your application's styles override the theme with plain selectors, no !important needed.
/* Customise a token… */
:root {
--theme-radius: 0;
}
/* …or override an element directly. */
a {
text-decoration: none;
}
Using cascade layers yourself? Put the theme first: @layer confirm, app;
All tokens
Generated from theme.css at build time, so it's always up to date.
No tokens found.
| Surfaces | ||
|---|---|---|
--theme-background |
cold-grey-100 | cold-grey-10 |
--theme-surface |
white | cold-grey-20 |
--theme-surface-raised |
white | cold-grey-30 |
--theme-border |
cold-grey-80 | cold-grey-30 |
| Text | ||
--theme-text |
cold-grey-10 | cold-grey-90 |
--theme-text-muted |
cold-grey-40 | cold-grey-60 |
| Primary | ||
--theme-primary |
orange-60 | orange-60 |
--theme-primary-hover |
orange-70 | orange-70 |
--theme-primary-contrast |
cold-grey-10 | cold-grey-10 |
--theme-primary-text |
orange-40 | orange-60 |
| Accent | ||
--theme-accent |
azure-40 | azure-60 |
--theme-accent-hover |
azure-30 | azure-70 |
--theme-accent-contrast |
white | cold-grey-10 |
| Success | ||
--theme-success |
green-60 | green-60 |
--theme-success-contrast |
cold-grey-10 | cold-grey-10 |
--theme-success-text |
green-40 | green-60 |
--theme-success-subtle |
green-100 | green-20 |
| Warning | ||
--theme-warning |
yellow-60 | yellow-60 |
--theme-warning-contrast |
cold-grey-10 | cold-grey-10 |
--theme-warning-text |
yellow-40 | yellow-60 |
--theme-warning-subtle |
yellow-100 | yellow-20 |
| Error | ||
--theme-error |
red-60 | red-60 |
--theme-error-contrast |
cold-grey-10 | cold-grey-10 |
--theme-error-text |
red-40 | red-60 |
--theme-error-subtle |
red-100 | red-20 |
| Info | ||
--theme-info |
blue-60 | blue-60 |
--theme-info-contrast |
cold-grey-10 | cold-grey-10 |
--theme-info-text |
blue-40 | blue-60 |
--theme-info-subtle |
blue-100 | blue-20 |
| Interaction | ||
--theme-link |
→ --theme-primary-text (orange-40) | → --theme-primary-text (orange-60) |
--theme-link-hover |
orange-30 | orange-70 |
--theme-focus |
→ --theme-accent (azure-40) | → --theme-accent (azure-60) |
--theme-shadow-color |
rgb(8 10 14 / 12%) | rgb(0 0 0 / 50%) |
--theme-shadow |
0 1px 2px var(--theme-shadow-color), 0 4px 16px var(--theme-shadow-color) | 0 1px 2px var(--theme-shadow-color), 0 4px 16px var(--theme-shadow-color) |
--theme-transition |
150ms ease | 150ms ease |
| Typography | ||
--theme-font-sans |
"Poppins", system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif | "Poppins", system-ui, -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", "Arial", sans-serif |
--theme-font-mono |
"Roboto Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace | "Roboto Mono", ui-monospace, "SF Mono", "Menlo", "Consolas", monospace |
--theme-font-size |
1rem | 1rem |
--theme-font-size-sm |
0.8rem | 0.8rem |
--theme-font-size-lg |
clamp(1.2rem, 1.18rem + 0.087vw, 1.25rem) | clamp(1.2rem, 1.18rem + 0.087vw, 1.25rem) |
--theme-font-size-xl |
clamp(1.44rem, 1.392rem + 0.213vw, 1.562rem) | clamp(1.44rem, 1.392rem + 0.213vw, 1.562rem) |
--theme-font-size-2xl |
clamp(1.728rem, 1.64rem + 0.392vw, 1.953rem) | clamp(1.728rem, 1.64rem + 0.392vw, 1.953rem) |
--theme-font-size-3xl |
clamp(2.074rem, 1.93rem + 0.64vw, 2.441rem) | clamp(2.074rem, 1.93rem + 0.64vw, 2.441rem) |
| Font weights | ||
--theme-font-weight-light |
300 | 300 |
--theme-font-weight-regular |
400 | 400 |
--theme-font-weight-medium |
500 | 500 |
--theme-font-weight-semibold |
600 | 600 |
--theme-font-weight-bold |
700 | 700 |
| Line heights | ||
--theme-line-height |
1.5 | 1.5 |
--theme-line-height-heading |
1.2 | 1.2 |
| Spacing | ||
--theme-space-xs |
0.25rem | 0.25rem |
--theme-space-sm |
0.5rem | 0.5rem |
--theme-space |
1rem | 1rem |
--theme-space-lg |
1.5rem | 1.5rem |
--theme-space-xl |
2rem | 2rem |
--theme-space-2xl |
3rem | 3rem |
| Radii | ||
--theme-radius-sm |
4px | 4px |
--theme-radius |
8px | 8px |
--theme-radius-lg |
16px | 16px |
--theme-radius-round |
999px | 999px |
| Widths | ||
--theme-content-width |
75rem | 75rem |
--theme-text-width |
70ch | 70ch |