Skip to content

Themes

Every component reads semantic CSS variables. Change the variables and the whole app follows.

Design tokens

Tokens such as --background, --foreground, --primary, --muted, --border, --ring and --radius map to Tailwind utilities (bg-primary, text-muted-foreground, rounded-lg) through the @theme block of the Atlas stylesheet. Shape and depth are tokens too: --button-radius, --surface-radius, --surface-shadow and --elevation-1 to --elevation-4, which drive shadow-sm, shadow-md, shadow-lg and shadow-2xl. Focus rings read --focus-ring-width and --focus-ring-offset, control heights --control-height-sm, --control-height and --control-height-lg. Fonts follow Tailwind's own --font-sans.

--background

--foreground

--primary

--secondary

--muted

--accent

--destructive

--border

Built-in themes

The library ships one theme, Atlas · Signature, with light, dark and high-contrast variants. Material · Azure, Material · Violet, Bootstrap · Blue and Bootstrap · Teal are app themes of this site, built only by overriding the tokens. Try them here — the whole documentation site switches with the picker in the top bar:

Preview

The components where each token group shows, in the theme picked above or in one of your own themes:

Preview

Actions

Form controls

We never share it.

Use 3 to 6 letters.

Surface

Quarterly report

Muted text sits on the card surface.

Revenue grew 12% against the previous quarter.

defaultprimarysecondaryoutlinesuccesswarninginfodestructive

Status

Information

A new version is available.

Success

Your changes were saved.

Warning

Your trial ends in 3 days.

Error

The upload failed.

Navigation

Overlays

Dark mode

Atlas · Signature switches to dark with the dark class on <html> and to high contrast with high-contrast. An app theme adds its dark variant as .theme-x.dark, so class="theme-material dark" picks it; the toggle in the top bar does that for every theme here except high contrast.

Your own theme

The theme designer (the palette button in the top bar) has a page of its own: every component in a gallery, in light, dark or both, beside a panel that edits every token, for the whole theme or for one component. It generates light and dark from a brand colour, checks contrast and exports the finished CSS file.

Open the theme designer

Add the exported file to your app with the theme schematic: it copies it into src/styles/, imports it right after the Atlas theme and puts its class on <html>.

Terminal
ng generate @atlas/components:theme ./my-brand.css

To write one by hand:

Restate the token contract under your own class and put the class on <html> so dialogs and popovers rendered in the overlay container are themed too:

src/styles/my-brand.css
.my-brand {
    --background: #ffffff;
    --foreground: #0f172a;
    --primary: #0d9488;
    --primary-foreground: #ffffff;
    --muted: #f1f5f9;
    --muted-foreground: #475569;
    --border: #e2e8f0;
    --ring: #0d9488;
    --radius: 0.75rem;
    --button-radius: 9999px; /* pill buttons */
    --surface-shadow: none;
    --elevation-2: 0 2px 6px 2px rgb(0 0 0 / 0.15); /* menus, popovers */
    --focus-ring-width: 3px;
    --control-height: 2.375rem;
    --font-sans: Roboto, system-ui, sans-serif;
    /* …the rest of the token contract */
}

Check your theme's contrast

checkThemeContrast() from @atlas/components/core checks your colours against every token pair Atlas components put text or indicators on: 4.5:1 for text, 3:1 for focus rings, control borders and selected states. Values are hex or rgb() colours; the two decorative border pairs are reported as accepted. Run it in a spec so a colour change cannot break legibility unnoticed:

src/styles/my-brand.spec.ts
import { checkThemeContrast } from '@atlas/components/core';

const light = {
    background: '#ffffff',
    foreground: '#0f172a',
    primary: '#0d9488',
    'primary-foreground': '#ffffff',
    // …every colour token of your theme, without the leading --
};

it('keeps every Atlas token pair readable', () => {
    const failures = checkThemeContrast(light).filter((r) => r.status === 'fail');
    expect(failures).toEqual([]);
});