Cornerstone themes apply a cohesive look and feel across the entire library, built from stackable layers — a theme, a color palette, variants, and a light or dark color scheme — that you mix and match with classes on the <html> element.

Try it live! Use the Theme and Color Scheme selectors in this site’s header to preview themes or switch light/dark modes.

Key Concepts

Themes

.cs-theme-{name}

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.

Your theme is determined by class="cs-theme-{name}" on the <html> element. If no class is specified, the default theme is used.

Browse Built-in Themes

Color Palettes

.cs-palette-{name}

A color palette is the full set of 10 hues — red, orange, yellow, green, cyan, blue, indigo, purple, pink, and gray — each with 11 tints from 05 (darkest) to 95 (lightest), all available as color design tokens.

Each palette has its own hue shifts and chroma, so swapping palettes changes the entire feel of your project — especially alongside a theme and variant colors. Your palette is determined by class="cs-palette-{name}" on the <html> element; if no class is specified, the default palette is used.

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
Browse All Palettes

Variants

.cs-{variant}-{hue}

Variants assign palette hues to semantic roles — brand, neutral, 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
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, then put its class on the <html> element. 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.

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
Switch color palettesLoad the palette stylesheet, then add class="cs-palette-{name}" to <html>Browse Palettes
Use a different themeLoad the theme stylesheet, then add class="cs-theme-{name}" to <html>Built-in 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