Color shades and aliases
overview
Mantine uses CSS variables to define color shades. CSS variables start with the --mantine-color prefix.
- Mantine defines 14 colors.
- Mantine defines 10 shades for each color, 0 to 9, following the pattern of
--mantine-color-dark-0. - It defines aliases, or semantic CSS variables, such as
--mantine-color-text, which resolve to a given shade, such as--mantine-color-dark-0.- The resolved value depends on the active color scheme:
darkorlight(see below).
- The resolved value depends on the active color scheme:
Some aliases are linked to a specific variant. For example, --mantine-color-default is linked to the default variant, and defines its background color.
dark color-scheme values
The aliases resolve to the following values:
| semantic suffixes | value | note |
|---|---|---|
| --mantine-color-bright | --mantine-color-white | text |
| -text | --mantine-color-dark-0 | text |
| -dimmed | --mantine-color-dark-2 | text |
| -placeholder | --mantine-color-dark-3 | text |
| -body | --mantine-color-dark-7 | background |
| -anchor | --mantine-color-blue-4 | link |
| -error | --mantine-color-red-8 | form error |
| -red-text | --mantine-color-red-4 | ? |
| -scheme | "dark" |
variant: "default" aliases
note: it comes with a border.
While the default for hover is dark-5, we can also use dark-4 or dark-6.
| semantic suffixes | value | note |
|---|---|---|
| default-color | --mantine-color-white | text |
| default | --mantine-color-dark-6 | background |
| default-hover | --mantine-color-dark-5 | background |
| default-border | --mantine-color-dark-4 | border |
color: "dark" aliases
it comes with values for several variants. It has no border.
| semantic suffixes | value |
|---|---|
| dark-text | --mantine-color-dark-4 |
| dark-filled | --mantine-color-dark-8 |
| dark-filled-hover | --mantine-color-dark-7 |
| dark-light | rgba(36, 36, 36, 0.15) |
| dark-light-hover | rgba(36, 36, 36, 0.2) |
| dark-light-color | --mantine-color-dark-3 |
| dark-outline | --mantine-color-dark-4 |
| dark-outline-hover | rgba(36, 36, 36, 0.05) |
color: "gray" aliases
it comes with values for several variants.
| suffix | value |
|---|---|
| gray-text | --mantine-color-gray-4 |
| gray-filled | --mantine-color-gray-8 |
| gray-filled-hover | --mantine-color-gray-9 |
| gray-light | rgba(134, 142, 150, 0.15) |
| gray-light-hover | rgba(134, 142, 150, 0.2) |
| gray-light-color | --mantine-color-gray-3 |
| gray-outline | --mantine-color-gray-4 |
| gray-outline-hover | rgba(206, 212, 218, 0.05) |