Design Tokens Color

Color

Web Awesome's color system is made up of three layers: a color palette that gives you a full spectrum of hues, variant colors that define semantic color variations (like success and danger), and theme colors that assign tints from your palette and variant colors to tokens that style components.

Color Palette

Color palettes give you a full spectrum of colors to use in your project and are the lowest-level color tokens. Each color palette includes 10 different hues, each with 11 numeric tints that make up a color scale from light to dark — 95 is near white, 05 is near black.

These numeric tints help ensure accessible color contrast per WCAG 2.1 success criteria:

--wa-color-red-*
--wa-color-orange-*
--wa-color-yellow-*
--wa-color-green-*
--wa-color-cyan-*
--wa-color-blue-*
--wa-color-indigo-*
--wa-color-purple-*
--wa-color-pink-*
--wa-color-gray-*

Core Colors

In addition to numeric tints, each hue has a core color — the most colorful, vibrant tint in the scale. The exact tint varies by palette. Use --wa-color-{hue} when you want a representative color for a hue without specifying a tint.

The tint for each core color is stored as an integer in --wa-color-{hue}-key. These tokens are used internally to determine a compatible text color when using the core color as a background and are not used directly by components.

Using this key, the color system derives a paired on color guaranteed to meet WCAG 2.1 AA contrast when placed on top of the corresponding core color. If the core tint is light (≥ 60), the on color is a dark shade of that hue; otherwise it is white. Use --wa-color-{hue}-on any time you render text or icons on a core color background.

Variant Colors

Variant colors are aliases for specific hues in your color palette to give them an extra layer of semantic meaning. These variants are familiar, meaningful hues that reinforce a specific message or intended use:

Each variant color is an alias for a palette color and follows the same token format: --wa-color-{variant}-{tint}.

--wa-color-brand-*
--wa-color-neutral-*
--wa-color-success-*
--wa-color-warning-*
--wa-color-danger-*

Core Colors

Just like the hues in your color palette, each variant has a core color — an alias for the most colorful, vibrant tint in the color scale selected for your variant. Use --wa-color-{variant} when you want a representative color for a variant without specifying a tint.

Each core color also has a paired on color (--wa-color-{variant}-on) guaranteed to meet WCAG 2.1 AA contrast when placed on top of it. Use on color tokens any time you render text or icons on a core color background.

Changing Variant Colors

Any hue from your color palette can be assigned to any variant without redefining the tokens in your own stylesheet. To use a different hue, simply apply the class "wa-{variant}-{hue} to the <html> element.

<html class="wa-brand-purple wa-success-cyan">

All ten palette hues — red, orange, yellow, green, cyan, blue, indigo, purple, pink, and gray — are available for every variant.

Theme Colors

Theme colors assign specific tints from your color palette and variant colors to design tokens that style elements and components. These tokens are named for their role rather than their appearance and are designed to adapt to light and dark modes.

Surfaces

Surfaces are background layers that content rests on. They convey elevation hierarchy — raised is closest to the user (e.g., dialogs) and lowered is farthest away (e.g., wells).

Text

Text colors are used for readable content. We recommend a minimum 4.5:1 contrast ratio against surface colors for text colors.

Overlays

Overlays provide a backdrop that isolates content, often with some transparency so background context shows through.

Shadow

A single color is used for all drop shadows. Use it alongside the shadow tokens to construct realistic shadows.

Interactions

These tokens power consistent hover, active, and focus states across all interactive components.

Semantic Variants

Semantic variants use the --wa-color-{variant}-{tint} tokens from your variant colors to power the variant="" attribute shared by buttons, badges, callouts, and many other components. Each variant is a complete, self-contained color system built from five groups — brand, success, neutral, warning, and danger — each defining fills, borders, and on colors at three attention levels.

Tokens follow the format --wa-color-{variant}-{role}-{attention}. The three roles are:

The three attention levels are quiet, normal, and loud — from least to most visually prominent.

    No results