Cornerstone’s theming gives the whole library one look and feel. It has four layers: a theme, a color palette, variants, and a light or dark color scheme. The stylesheet you load picks the theme, and the theme brings its own palette. Classes set the variants and the color scheme, on the <html> element or on any section.

Try it live! Use the color scheme menu in this site’s header to switch between light and dark mode, or between Cru’s and FamilyLife’s themes. FamilyLife’s theme shows the system font here rather than Akkurat, and Built-in Themes says why.

Key Concepts

Themes

styles/themes/{name}.css

A theme is the overall look — fonts, borders, space, shadows, and how each variant gets used across components. Two themes can share a palette and variants and still feel completely different. Themes ship with a default palette and may include custom CSS overrides for individual components.

The stylesheet you load picks your theme, not a class. cornerstone.css loads Cru’s theme, so with no extra stylesheet and no class, you get Cru’s. To use FamilyLife’s theme instead, load its stylesheet after cornerstone.css, as Using Themes shows. Load one theme per page.

Each theme also matches a cs-theme-{name} class, but the class doesn’t switch themes, and it doesn’t limit a theme to one section. It only re-applies part of a theme that is already loaded: its fonts, sizes, and which shades it uses for surfaces, text and fills. The hues still come from the page root, so on a page with two themes loaded, a cs-theme-{name} section gets a blend of both.

Browse Built-in Themes

Color Palettes

--cs-color-{hue}-{tint}

A color palette is a theme’s set of hues, each with 11 tints from 05 (darkest) to 95 (lightest), all available as color design tokens. Each brand names its own hues, so the list changes from theme to theme.

Each palette has its own hue shifts and chroma, so the palette sets much of a project’s feel, along with the theme and variant colors. You don’t pick a palette on its own: each theme’s stylesheet loads the palette it needs. Cru’s and FamilyLife’s palettes have no class. Only the reference palette that comes with themes/default.css has one, cs-palette-default.

Cru

19 hues. To see another brand's palette, pick it in the header menu.

Lemon
--cs-color-lemon-*
95
90, the key step
80
70
60
50
40
30
20
10
05
Yellow
--cs-color-yellow-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Orange
--cs-color-orange-*
95
90
80
70
60, the key step
50
40
30
20
10
05
Vermilion
--cs-color-vermilion-*
95
90
80
70
60
50, the key step
40
30
20
10
05
Rose
--cs-color-rose-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Pink
--cs-color-pink-*
95
90
80
70
60, the key step
50
40
30
20
10
05
Cerise
--cs-color-cerise-*
95
90
80
70
60
50, the key step
40
30
20
10
05
Ruby
--cs-color-ruby-*
95
90
80
70
60
50
40
30, the key step
20
10
05
Sky
--cs-color-sky-*
95
90, the key step
80
70
60
50
40
30
20
10
05
Cyan
--cs-color-cyan-*
95
90
80
70, the key step
60
50
40
30
20
10
05
Turquoise
--cs-color-turquoise-*
95
90
80
70
60
50, the key step
40
30
20
10
05
Navy
--cs-color-navy-*
95
90
80
70
60
50
40
30
20
10, the key step
05
Mint
--cs-color-mint-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Green
--cs-color-green-*
95
90
80
70, the key step
60
50
40
30
20
10
05
Moss
--cs-color-moss-*
95
90
80
70
60
50
40, the key step
30
20
10
05
Olive-drab
--cs-color-olive-drab-*
95
90
80
70
60
50
40
30
20, the key step
10
05
Gray
--cs-color-gray-*
95, the key step
90
80
70
60
50
40
30
20
10
05
Graphite
--cs-color-graphite-*
95
90
80
70
60
50
40, the key step
30
20
10
05
Purple
--cs-color-purple-*
95
90
80
70
60
50, the key step
40
30
20
10
05
FamilyLife

10 hues. To see another brand's palette, pick it in the header menu.

Yellow
--cs-color-yellow-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Orange
--cs-color-orange-*
95
90
80
70
60, the key step
50
40
30
20
10
05
Pink
--cs-color-pink-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Blue
--cs-color-blue-*
95
90
80
70
60, the key step
50
40
30
20
10
05
Dark-green
--cs-color-dark-green-*
95
90
80
70
60
50
40, the key step
30
20
10
05
Mint
--cs-color-mint-*
95
90
80, the key step
70
60
50
40
30
20
10
05
Ruby
--cs-color-ruby-*
95
90
80
70
60
50
40
30, the key step
20
10
05
Soft-black
--cs-color-soft-black-*
95
90
80
70
60
50
40
30
20
10, the key step
05
Off-white
--cs-color-off-white-*
95, the key step
90
80
70
60
50
40
30
20
10
05
Cool-gray
--cs-color-cool-gray-*
95
90
80
70, the key step
60
50
40
30
20
10
05
Browse All Palettes

Variants

.cs-{variant}-{hue}

Variants assign palette hues to semantic roles — brand, neutral, highlight, information, success, warning, and danger among them — so components like buttons and callouts can convey meaning through color. Any hue from your palette can be assigned to any variant with class="cs-{variant}-{hue}". Apply the class to the <html> element to set variants globally, to a wrapper to scope them to one section, or to a single component to override just that element. For deeper customization, override the --cs-color-{variant}-* tokens in your own CSS.

Brand
--cs-color-brand-*
95
90
80
70
60
50
40
30
20
10
05
Neutral
--cs-color-neutral-*
95
90
80
70
60
50
40
30
20
10
05
Highlight
--cs-color-highlight-*
95
90
80
70
60
50
40
30
20
10
05
Information
--cs-color-information-*
95
90
80
70
60
50
40
30
20
10
05
Success
--cs-color-success-*
95
90
80
70
60
50
40
30
20
10
05
Warning
--cs-color-warning-*
95
90
80
70
60
50
40
30
20
10
05
Danger
--cs-color-danger-*
95
90
80
70
60
50
40
30
20
10
05
See Variant Tokens

Light and Dark Mode

.cs-light .cs-dark

Every theme is designed to adapt to light and dark mode. Light mode applies by default; apply class="cs-light" or class="cs-dark" to set the color scheme on the page or on any section. Because the classes cascade, a dark page can hold a light section, and the components inside each pick up the scheme around them.

Light

Whipped cream Hershey's Kisses Jelly beans Make Waffles

Dark

Whipped cream Hershey's Kisses Jelly beans Make Waffles

Using Themes

Load the theme’s stylesheet. No class is needed: once it loads, the theme covers the whole page. Cru’s theme is the default, and cornerstone.css already loads it. The snippets below cover each way of loading it.

npm Self-Hosted

After installing @cruglobal/cornerstone-components, import the theme's stylesheet:

import '@cruglobal/cornerstone-components/styles/themes/cru.css';

Importing it is all that is needed — this theme applies at the document root rather than under a class.

If you are self-hosting Cornerstone, include the theme's stylesheet from your server:

<link rel="stylesheet" href="/cornerstone-design-system/dist/styles/themes/cru.css" />

Importing it is all that is needed — this theme applies at the document root rather than under a class.

Loading FamilyLife’s theme

To use FamilyLife’s theme, load styles/themes/fl.css after cornerstone.css:

import '@cruglobal/cornerstone-components/styles/cornerstone.css';
import '@cruglobal/cornerstone-components/styles/themes/fl.css';
<link rel="stylesheet" href="/cornerstone/styles/cornerstone.css" />
<link rel="stylesheet" href="/cornerstone/styles/themes/fl.css" />

The order matters because cornerstone.css carries Cru’s theme. Both themes set their values on the page root with the same strength, and when two rules tie like that, the one loaded last wins. Load fl.css first and Cru’s values replace FamilyLife’s, so the page looks like Cru. Load it last and FamilyLife’s values win everywhere.

You still need cornerstone.css, because it also brings the native element styles and the utility classes, and fl.css has neither.

Keep to one theme per page. The two palettes share some hue names (yellow, orange, pink, mint and ruby), so two themes on one page blend together, and a cs-theme-* class can’t pull them apart.

Creating Your Own

You can build a custom theme with custom CSS, overriding design tokens in your own stylesheet.

Quick Reference

TaskHow ToLearn More
Change my brand colorAdd class="cs-brand-{hue}" to <html>Changing Variants
Use a different paletteLoad the theme that carries it; each theme loads its own paletteBrowse Palettes
Use FamilyLife’s themeLoad styles/themes/fl.css after cornerstone.css; no class neededUsing Themes
Toggle dark modeAdd class="cs-dark" to <html> (or any section)Light and Dark Mode
Override a single tokenDefine a --cs-* custom property associated with a design tokenCustomizing With CSS