Sass

February 20, 2025 ยท View on GitHub

Sass documentation for @carbon/colors

Usage

The @carbon/colors package enables you to access colors from the IBM Design Language in Sass. You can access a color directly from the package by writing the following:

@use '@carbon/colors';

.selector {
  background: colors.$blue-50;
}

For a full list of colors exported, refer to the API section below.

In addition to individual colors, you can also access a Map of all colors from the IBM Design Language using the $colors variable.

@use '@carbon/colors';

@each $swatch, $grades in colors.$colors {
  @each $grade in $grades {
    //
  }
}

Each key in the $colors map is the name of a group of colors, also known as a swatch. The value of each entry is a Map where the keys are the color grade and the values are the hex codes for the color at that grade. For example:

$colors: (
  blue: (
    10: #edf5ff,
    20: #d0e2ff,
    30: #a6c8ff,
    40: #78a9ff,
    50: #4589ff,
    60: #0f62fe,
    70: #0043ce,
    80: #002d9c,
    90: #001d6c,
    100: #001141,
  ),
);

API

NameType
$colorsMap
$blackColor
$whiteColor
$black-100Color
$blue-10Color
$blue-20Color
$blue-30Color
$blue-40Color
$blue-50Color
$blue-60Color
$blue-70Color
$blue-80Color
$blue-90Color
$blue-100Color
$cool-gray-10Color
$cool-gray-20Color
$cool-gray-30Color
$cool-gray-40Color
$cool-gray-50Color
$cool-gray-60Color
$cool-gray-70Color
$cool-gray-80Color
$cool-gray-90Color
$cool-gray-100Color
$cyan-10Color
$cyan-20Color
$cyan-30Color
$cyan-40Color
$cyan-50Color
$cyan-60Color
$cyan-70Color
$cyan-80Color
$cyan-90Color
$cyan-100Color
$gray-10Color
$gray-20Color
$gray-30Color
$gray-40Color
$gray-50Color
$gray-60Color
$gray-70Color
$gray-80Color
$gray-90Color
$gray-100Color
$green-10Color
$green-20Color
$green-30Color
$green-40Color
$green-50Color
$green-60Color
$green-70Color
$green-80Color
$green-90Color
$green-100Color
$magenta-10Color
$magenta-20Color
$magenta-30Color
$magenta-40Color
$magenta-50Color
$magenta-60Color
$magenta-70Color
$magenta-80Color
$magenta-90Color
$magenta-100Color
$orange-10Color
$orange-20Color
$orange-30Color
$orange-40Color
$orange-50Color
$orange-60Color
$orange-70Color
$orange-80Color
$orange-90Color
$orange-100Color
$purple-10Color
$purple-20Color
$purple-30Color
$purple-40Color
$purple-50Color
$purple-60Color
$purple-70Color
$purple-80Color
$purple-90Color
$purple-100Color
$red-10Color
$red-20Color
$red-30Color
$red-40Color
$red-50Color
$red-60Color
$red-70Color
$red-80Color
$red-90Color
$red-100Color
$teal-10Color
$teal-20Color
$teal-30Color
$teal-40Color
$teal-50Color
$teal-60Color
$teal-70Color
$teal-80Color
$teal-90Color
$teal-100Color
$warm-gray-10Color
$warm-gray-20Color
$warm-gray-30Color
$warm-gray-40Color
$warm-gray-50Color
$warm-gray-60Color
$warm-gray-70Color
$warm-gray-80Color
$warm-gray-90Color
$warm-gray-100Color
$white-0Color
$yellow-10Color
$yellow-20Color
$yellow-30Color
$yellow-40Color
$yellow-50Color
$yellow-60Color
$yellow-70Color
$yellow-80Color
$yellow-90Color
$yellow-100Color
$white-hoverColor
$black-hoverColor
$blue-10-hoverColor
$blue-20-hoverColor
$blue-30-hoverColor
$blue-40-hoverColor
$blue-50-hoverColor
$blue-60-hoverColor
$blue-70-hoverColor
$blue-80-hoverColor
$blue-90-hoverColor
$blue-100-hoverColor
$cool-gray-10-hoverColor
$cool-gray-20-hoverColor
$cool-gray-30-hoverColor
$cool-gray-40-hoverColor
$cool-gray-50-hoverColor
$cool-gray-60-hoverColor
$cool-gray-70-hoverColor
$cool-gray-80-hoverColor
$cool-gray-90-hoverColor
$cool-gray-100-hoverColor
$cyan-10-hoverColor
$cyan-20-hoverColor
$cyan-30-hoverColor
$cyan-40-hoverColor
$cyan-50-hoverColor
$cyan-60-hoverColor
$cyan-70-hoverColor
$cyan-80-hoverColor
$cyan-90-hoverColor
$cyan-100-hoverColor
$gray-10-hoverColor
$gray-20-hoverColor
$gray-30-hoverColor
$gray-40-hoverColor
$gray-50-hoverColor
$gray-60-hoverColor
$gray-70-hoverColor
$gray-80-hoverColor
$gray-90-hoverColor
$gray-100-hoverColor
$green-10-hoverColor
$green-20-hoverColor
$green-30-hoverColor
$green-40-hoverColor
$green-50-hoverColor
$green-60-hoverColor
$green-70-hoverColor
$green-80-hoverColor
$green-90-hoverColor
$green-100-hoverColor
$magenta-10-hoverColor
$magenta-20-hoverColor
$magenta-30-hoverColor
$magenta-40-hoverColor
$magenta-50-hoverColor
$magenta-60-hoverColor
$magenta-70-hoverColor
$magenta-80-hoverColor
$magenta-90-hoverColor
$magenta-100-hoverColor
$orange-10-hoverColor
$orange-20-hoverColor
$orange-30-hoverColor
$orange-40-hoverColor
$orange-50-hoverColor
$orange-60-hoverColor
$orange-70-hoverColor
$orange-80-hoverColor
$orange-90-hoverColor
$orange-100-hoverColor
$purple-10-hoverColor
$purple-20-hoverColor
$purple-30-hoverColor
$purple-40-hoverColor
$purple-50-hoverColor
$purple-60-hoverColor
$purple-70-hoverColor
$purple-80-hoverColor
$purple-90-hoverColor
$purple-100-hoverColor
$red-10-hoverColor
$red-20-hoverColor
$red-30-hoverColor
$red-40-hoverColor
$red-50-hoverColor
$red-60-hoverColor
$red-70-hoverColor
$red-80-hoverColor
$red-90-hoverColor
$red-100-hoverColor
$teal-10-hoverColor
$teal-20-hoverColor
$teal-30-hoverColor
$teal-40-hoverColor
$teal-50-hoverColor
$teal-60-hoverColor
$teal-70-hoverColor
$teal-80-hoverColor
$teal-90-hoverColor
$teal-100-hoverColor
$warm-gray-10-hoverColor
$warm-gray-20-hoverColor
$warm-gray-30-hoverColor
$warm-gray-40-hoverColor
$warm-gray-50-hoverColor
$warm-gray-60-hoverColor
$warm-gray-70-hoverColor
$warm-gray-80-hoverColor
$warm-gray-90-hoverColor
$warm-gray-100-hoverColor
$yellow-10-hoverColor
$yellow-20-hoverColor
$yellow-30-hoverColor
$yellow-40-hoverColor
$yellow-50-hoverColor
$yellow-60-hoverColor
$yellow-70-hoverColor
$yellow-80-hoverColor
$yellow-90-hoverColor
$yellow-100-hoverColor