Skip to main content

Colors

Colors are a key component of any design system. They convey meaning, attract attention, and give feedback. Mantle's color system is accessible and flexible, with a dark mode.

Tailwind

Mantle uses Tailwind under the hood for all its CSS styling. However, we differ from Tailwind when it comes to colors. Mantle ships a full color library with an automatic dark mode. This is different from standard Tailwind usage that requires dark class variations. Specify Mantle's light colors and you get dark mode for free. If you require additional customization, you can add dark variant classes as an override.

Variables

Mantle's colors are delivered as CSS variables via Tailwind's API e.g. .text-blue-500. They can be directly accessed via var(--color-blue-500) and use oklch() color space.

Black and white color variables

Mantle overrides what "black" and "white" mean depending on the theme. They are semantic colors, not literal ones. In dark mode, we swap them so that white is actually black and vice versa. Pay attention to the example below when swapping between our themes!

This renders bg-white and color text-black.

The current applied theme is light

Overrides

Most colors should appropriately swap for sensible values in dark mode. However, there are often cases where you'll need to specify an override. The dark: variant is well-documented on Tailwind's website.

Functional colors

Mantle generally limits its color choices to the following functional colors for primary actions, and various states like danger and warnings.

Neutral

950
900
800
700
600
500
400
300
200
100
50

Accent

950
900
800
700
600
500
400
300
200
100
50

Info

950
900
800
700
600
500
400
300
200
100
50

Important

950
900
800
700
600
500
400
300
200
100
50

Success

950
900
800
700
600
500
400
300
200
100
50

Danger

950
900
800
700
600
500
400
300
200
100
50

Warning

950
900
800
700
600
500
400
300
200
100
50

Extended palette

Mantle also supports a curated subset of Tailwind's color palette in light, dark, and high contrast variants. These are to be used when there is no functional meaning behind the color choice. We've left out the extended collection of Tailwind's grays eg. slate, zinc, etc. since we only want to use our own custom branded gray.

Gray

950
900
800
700
600
500
400
300
200
100
50

Amber

950
900
800
700
600
500
400
300
200
100
50

Lime

950
900
800
700
600
500
400
300
200
100
50

Emerald

950
900
800
700
600
500
400
300
200
100
50

Sky

950
900
800
700
600
500
400
300
200
100
50

Purple

950
900
800
700
600
500
400
300
200
100
50

Fuchsia

950
900
800
700
600
500
400
300
200
100
50

Pink

950
900
800
700
600
500
400
300
200
100
50

Rose

950
900
800
700
600
500
400
300
200
100
50

Reserve palette

These additional colors are available when you need more color variety than the extended palette covers, such as for line charts, data visualization, or categorical distinctions. They are less harmonious with the rest of the Mantle palette, so prefer functional and extended colors first.

Red

950
900
800
700
600
500
400
300
200
100
50

Orange

950
900
800
700
600
500
400
300
200
100
50

Yellow

950
900
800
700
600
500
400
300
200
100
50

Green

950
900
800
700
600
500
400
300
200
100
50

Teal

950
900
800
700
600
500
400
300
200
100
50

Cyan

950
900
800
700
600
500
400
300
200
100
50

Blue

950
900
800
700
600
500
400
300
200
100
50

Indigo

950
900
800
700
600
500
400
300
200
100
50

Violet

950
900
800
700
600
500
400
300
200
100
50