Skip to content

Theme

Colors

Learn how to change the color of elements.

Backgrounds

Note, that primary colors are unique for each customer: they come from the theme (see Theme Editor Colors). The primary classes are deprecated — they are kept for backwards compatibility and their names don't match their use.

CSS ClassVariableResult
.bg-white--white (surface; dark in dark mode)
.bg-base--bg-color-base (page background)
.bg-n1--n1-transp
.bg-n2--n2-transp
.bg-n4--n4
.bg-n5--n5
.bg-n6--n6
.bg-n7--n7
.bg-primaryDeprecated--primary
Instead, use --btn-primary-hover-color
.bg-primary-d1Deprecated--primary-d1
Instead, use --btn-primary-color
.bg-primary-lDeprecated--primary-l
Instead, use .highlight or --highlight-bg-color
.bg-green--g3
.bg-green-l--g1
.bg-yellow--y2
.bg-yellow-l--y1
.bg-red--r3
.bg-red-l--r1
.bg-blue--b3
.bg-blue-l--b1
.bg-icon-brand--icon-brand

Overlays

Overlay classes are layered on top of images or content, usually on an absolutely positioned element that covers its container.

CSS ClassEffectResult
.bg-overlay-brandTints an image with the brand color, e.g. behind white text
--background-overlay-color
.bg-overlay-primaryPrimary overlay color plus a dark gradient at the bottom, for captions on images
--bg-overlay-color-primary + --bg-overlay-gradient
.bg-overlay-whiteLight veil (dark in dark mode)
--white-overlay
.bg-overlay-greyNeutral grey veil
--bg-overlay-color-grey
.bg-backdrop-blurDark translucent backdrop that blurs what's behind it (falls back to 60% black)
—

Highlight

.highlight sets the theme's highlight background, text and icon colors together (--highlight-bg-color, --highlight-text-color, --highlight-icon-color). Use it for selected or featured items.

Highlighted item

Theme Editor Colors

Each customer picks these colors in Admin Center → Hub Experience → Theme (Components tab), with separate values for light and dark mode. Every component sets the variables listed next to it; use the variable instead of a fixed color so elements follow the customer's theme.

Variables marked adjusted are derived from the component's color (with a different opacity or lightness). Swatches show the demo theme used on this site.

The colors these variables use may change in the future, so use them with caution.
Theme Editor componentVariablesResult
Button Background
--btn-primary-color--btn-primary-shadow-color (adjusted)--primary-d1Deprecated
Button Background (Hover)
--btn-primary-hover-color--btn-primary-hover-shadow-color (adjusted)--primaryDeprecated--primary-d3 (adjusted)Deprecated
Button Text
--btn-text-color
Button Text (Hover)
--btn-text-hover-color
Borderless Button
--btn-borderless-active-text-color--btn-borderless-active-icon-color--btn-borderless-secondary-active-bg-color (adjusted)
Link Text
--link-color
Link Text (Hover)
--link-hover-color
Header Background
--header-color--secondaryDeprecated
Header Icons & Text
--header-fg-color
Tab Text
--tab-active-icon-color--tab-active-text-color
Tab Line
--tab-active-border-color--tab-focus-border-color (adjusted)
Avatar Background
--avatar-bg-color
Avatar Icon
--avatar-icon-color
Label Background
--label-bg-color
Label Text
--label-text-color
Icon, Focus Outline, Text/Input Accent
--icon-brand--text-brand--focus-outline-color--input-color--input-hover-color (adjusted)
Main Menu Background
--main-menu-bg-color
Main Menu Text
--main-menu-text-color
Main Menu Item Background (Hover)
--main-menu-item-bg-hover-color
Main Menu Text (Hover)
--main-menu-text-hover-color
Main Menu Active Item Background
--main-menu-active-item-bg-color
Main Menu Active Item Text
--main-menu-active-item-text-color
Highlighted Item Background
--highlight-bg-color--primary-lDeprecated
Highlighted Item Text
--highlight-text-color (adjusted)--highlight-icon-color (adjusted)
Message Bubble
--message-bubble-bg
Badge
--badge-bg-brand
Image Overlay
--background-overlay-color--bg-overlay-color-primary--primary-d2Deprecated
Quick Link Card Overlay
--quick-link-card-overlay
Base Page Background
--bg-color-base
Quick Link Capsule Background
--quick-link-capsule-bg-color
Quick Link Capsule Background (Hover)
--quick-link-capsule-bg-hover-color
Quick Link Capsule Text
--quick-link-capsule-text-color
Loader
--loader-color
Login/Error/Agreement Page Background
--login-config-issue-background-color--splash-background-color

Text Colors

Text color classes can also be used to change the color of icons. Learn how to add vector icons here.

CSS ClassResult
.text-baseDefault text color
.text-quietQuiet text color
.text-mutedMuted text color
.text-whiteWhite color with a subtle shadow
.text-brandBrand text color
.text-greenGreen text color
.text-yellowYellow text color
.text-redRed text color
.text-blueBlue text color

Each color also has an -important version (.text-base-important, .text-quiet-important, .text-muted-important, .text-white-important, .text-green-important, .text-yellow-important, .text-red-important, .text-blue-important) for overriding component styles that set their own color. Use them sparingly.

Border Colors

Borders use --border-color-base unless a color class is added. Color classes only set the color, so combine them with a border class such as .ba (see Borders).

CSS ClassVariableResult
—--border-color-base (default for every border class)
.border-red--r2
.border-green--g2
.border-yellow--y2
.border-blue--b2

Icon Colors

Icon color classes should be used to change the color of icons. They must be used together with the .icon class. Learn how to add vector icons here.

CSS ClassResult
.color-brand
.color-green
.color-yellow
.color-red
.color-n1
.color-n1-transp
.color-n2
.color-n2-transp
.color-n3
.color-n3-transp
.color-n4
.color-n4-transp
.color-n5-transp

Dark Mode

Dark mode is the .dark-theme class on <html>. The app adds it from the user's color mode setting (Light, Dark, or Auto, which follows the device), when the customer has dark mode enabled. You can preview it here with the Theme switch in the menu.

.dark-theme swaps the values of the color variables (--white, --n1…--n7, --color-base, the theme colors), so everything built with the classes and variables on this page adapts automatically. Hardcoded colors don't, which is why they should be avoided.

CSS ClassEffectResult
.dark-theme Renders the element and everything inside it with the dark palette. Add .bg-white to paint the dark surface

Card title

Quiet text and a link

Label
.force-light-theme The opposite: keeps the element light while the rest of the page is dark. Switch the site to Dark to see it

Card title

Quiet text and a link

Label
.force-dark-bg Paints a fixed dark background and light text, whatever the mode. Only those two colors change; links and buttons keep the current palette

Card title

Quiet text and a link

Label
.force-light-bg Paints a fixed white background and dark text, whatever the mode

Card title

Quiet text and a link

Label