Web Awesome's color system is made up of CSS custom properties to help with consistent color use throughout your project.
Color is organized by three main categories:
Literal colors are the lowest level color properties in your theme. Each color is identified by a name, like red or gray, and a number that roughly corresponds to the color's perceived lightness. On this scale, 100 is equal to pure white and 0 is equal to pure black.
Lightness values on this scale have a strong correlation to relative luminance, which is used to calculate color contrast. To meet WCAG 2.1 success criteria for minimum or enhanced contrast, even across hues, calculate the difference between the lightness values of any two colors:
Web Awesome defines seven literal colors each with 11 lightness values using the format
--wa-color-{name}-{#}
.
Foundational colors lay the groundwork for the content and structure of your project. These colors are named according to their role in your theme.
Surfaces are background layers that other content rests on. Surface colors help convey hierarchy through a
sense of elevation, where --wa-color-surface-raised
is the closest to the user (e.g., dialogs and
popup menus) and --wa-color-surface-lowered
is the farthest away (e.g., wells).
Custom Property | Preview |
---|---|
--wa-color-surface-raised |
|
--wa-color-surface-default |
|
--wa-color-surface-lowered |
|
--wa-color-surface-border |
Text colors are used for standard text elements. We recommend a minimum 4.5:1 contrast ratio between text colors and surface colors.
Custom Property | Preview |
---|---|
--wa-color-text-normal |
AaBb
|
--wa-color-text-quiet |
AaBb
|
--wa-color-text-link |
AaBb
|
Overlays provide a backdrop to isolate content, often allowing background context to show through.
Custom Property | Preview |
---|---|
--wa-color-overlay-modal |
|
--wa-color-overlay-inline |
Web Awesome uses a single color for all shadows. This is used alongside other shadow properties to construct your theme's shadows.
Custom Property | Preview |
---|---|
--wa-color-shadow |
Web Awesome uses a single focus color for predictable keyboard navigation. This is used alongside other
focus properties to construct --wa-focus-ring
. We recommend a
minimum 3:1 contrast ratio against surface colors and background colors wherever possible.
Custom Property | Preview |
---|---|
--wa-color-focus |
Web Awesome leverages color-mix()
to achieve consistent hover and active states across components
without the need for untold numbers of handpicked colors. Through color-mix()
, these custom
properties contextually generate hover and active colors based on the color of the component.
Custom Property | Preview |
---|---|
--wa-color-mix-hover |
mixed
|
--wa-color-mix-active |
mixed
|
Semantic colors reinforce a specific message, intended usage, or expected results through familiar, meaningful
hues. Each color is identified by its semantic group, role, and attention using the format
--wa-color-{group}-{role}-{attention}
. There are five groups of semantic colors:
Each group defines colors for specific roles so that colors can be easily assembled with predictable results and readable contrast. There are three roles:
--wa-color-danger-on-loud
with
--wa-color-danger-fill-loud
)
Finally, each color is named according to how much attention it draws. Here, we use noise as an analogy: a loud noise draws more attention than a quiet one. There are three levels of attention:
Custom Property | brand |
success |
neutral |
warning |
danger |
---|---|---|---|---|---|
--wa-color-*-fill-quiet |
|||||
--wa-color-*-fill-normal |
|||||
--wa-color-*-fill-loud |
|||||
--wa-color-*-border-quiet |
|||||
--wa-color-*-border-normal |
|||||
--wa-color-*-border-loud |
|||||
--wa-color-*-on-quiet |
AaBb
|
AaBb
|
AaBb
|
AaBb
|
AaBb
|
--wa-color-*-on-normal |
AaBb
|
AaBb
|
AaBb
|
AaBb
|
AaBb
|
--wa-color-*-on-loud |
AaBb
|
AaBb
|
AaBb
|
AaBb
|
AaBb
|