Skip to content

Color

Colors help focus attention and communicate intent.

Semantic color tokens provide theme-aware design tokens that automatically adapt to both light and dark mode. These tokens use meaningful names like text-default or bg-surface-app instead of specific color values and should be used in most situations.

Text colors are all designed with a contrast ratio of at least 4.5:1 (AA) against common backgrounds like bg-surface-app or bg-surface-nav.

Text colors with on- are used in conjunction with matching backgrounds:

  • text-on-element and text-on-element-dim are used with bg-element-primary and other bg-element- variants.
  • text-on-primary is used with bg-surface-primary, text-on-warning is used with bg-surface-warning, etc.
Name
Used for
Example
.text-defaultPrimary text colorThe quick brown fox
.text-dimSecondary text colorThe quick brown fox
.text-placeholderInput placeholder textThe quick brown fox
.text-primaryBrand-colored textThe quick brown fox
.text-successSuccess state textThe quick brown fox
.text-warningWarning state textThe quick brown fox
.text-errorError state textThe quick brown fox
.text-on-elementText on buttons and other high-contrast elementsThe quick brown fox
.text-on-element-dimIcons or secondary text on high-contrast elementsThe quick brown fox
.text-on-primaryText on primary banners, badgesThe quick brown fox
.text-on-successText on success banners, badgesThe quick brown fox
.text-on-warningText on warning banners, badgesThe quick brown fox
.text-on-errorText on error banners, badgesThe quick brown fox

Most interactive elements use border-default. In cases where a border is less important, such as dividing lines in a table, border-dim can be used instead.

Name
Used for
Example
.border-defaultMost borders: inputs, buttons, etc.
.border-dimSubtler borders: separators, table rows, etc.
.border-focusFocus states

Semantic background tokens are divided into four levels: surface, elements, scrims, and overlays.

Surface elements are the background of the application. These colors are low-contrast and intended to group elements together into sections without attracting too much attention.

Name
Used for
Example
.bg-surface-appMain app background
.bg-surface-navNavigation background
.bg-surface-neutralRow hovers, ghost buttons
.bg-surface-primaryPrimary banners, badges
.bg-surface-successSuccess banners, badges
.bg-surface-warningWarning banners, badges
.bg-surface-errorError banners, badges

Element backgrounds are higher-contrast to draw the user’s attention to specific actions or events. They are used for things like primary buttons, progress bars, switches, and other interactive or important UI.

Name
Used for
Example
.bg-element-primaryPrimary buttons
.bg-element-successSwitch toggles
.bg-element-warningWarning elements
.bg-element-errorError elements

Scrims appear inbetween any overlays and the rest of the application. They obscure the content behind it in order to draw the user’s focus to an overlay.

Name
Used for
Example
.bg-scrimOverlay backdrops

Overlays are the top layer. The overlay background is a ligher shade than the default app background, and is used for dialogs, popovers, tooltips, and other floating UI. It is usually paired with a drop shadow.

Name
Used for
Example
.bg-elevatedModals, popovers, tooltips

Use core colors directly when building data visualizations or implementing brand-specific elements. Otherwise, default to semantic colors.

Brand

Slate

Red

Orange

Yellow

Lime

Green

Teal

Cyan

Sky

Blue

Purple

Fuchsia

Pink

Rose

Colors in Figma are published from Stylus Design System and should be available by default in Figma files within the Scribe workspace.

Any colors in the palette can be used by applying the appropriate Tailwind CSS class to your element. Use the bg- prefix for background colors and text- prefix for text colors.