rainbow icon
🍔

Color

Color is modeled based on why something should be a certain color, defined with semantic names that allow them to adjust based on context. This makes it trivial to re-use components in different environments without having to manually adjust foreground colors.
For example, let's assume we have the following piece of text:
Lorem ipsum
<Text color="label" size="16pt" weight="bold">
  Lorem ipsum
</Text>
By default, this text will either be dark or light based on whether the app is in light mode or dark mode.
Now, imagine that this text was nested inside of a dark container across both light and dark modes:
Lorem ipsum
Lorem ipsum
<>
  <Box background="yellow" padding="20px">
    <Text size="20pt" weight="medium">
      Lorem ipsum
    </Text>
  </Box>
  <Box background="surfacePrimary" padding="20px">
    <Text size="20pt" weight="medium">
      Lorem ipsum
    </Text>
  </Box>
</>
Typically in this scenario we'd need to alter the text color so that it has sufficient contrast against the background. However, when setting a background with Box, the color mode is automatically configured for nested elements based on whether the background is dark or light, meaning that foreground colors usually won't need to be changed.

Background colors

Dark Mode
Light Mode
transparent
surfacePrimary
surfacePrimaryElevated
surfacePrimaryElevatedSecondary
surfaceSecondary
surfaceSecondaryElevated
surfaceMenu
fill
fillSecondary
white
blue
green
red
purple
pink
orange
yellow
shadowNear
shadowFar

Foreground colors

Color

Light Mode
blue
green
orange
pink
purple
red
yellow
Dark Mode
blue
green
orange
pink
purple
red
yellow

Text

Light Mode
label
labelSecondary
labelTertiary
labelQuaternary
blue
green
orange
pink
purple
red
yellow
Dark Mode
label
labelSecondary
labelTertiary
labelQuaternary
blue
green
orange
pink
purple
red
yellow

Scrim

Light Mode
scrim
scrimSecondary
scrimTertiary
Dark Mode
scrim
scrimSecondary
scrimTertiary

Separator

Light Mode
separator
separatorSecondary
separatorTertiary
Dark Mode
separator
separatorSecondary
separatorTertiary

Shadow

Light Mode
accent
fill
fillSecondary
surfacePrimaryElevated
surfacePrimaryElevatedSecondary
surfaceSecondaryElevated
blue
green
orange
pink
purple
red
yellow
Dark Mode
accent
fill
fillSecondary
surfacePrimaryElevated
surfacePrimaryElevatedSecondary
surfaceSecondaryElevated
blue
green
orange
pink
purple
red
yellow

Stroke

Light Mode
buttonStroke
buttonStrokeSecondary
Dark Mode
buttonStroke
buttonStrokeSecondary