Getting started
Colors
How the semantic colors are structured, and how you use them in light and dark mode.
Naming structure
The colors in Designsystemet are semantic. You don't choose a color based on how it looks, but based on what it will be used for. This makes it easier to use colors consistently across components, themes, and color modes.
The color names in Designsystemet are divided into 3 parts: Name of the color scale, group (area of use), and variant. These parts describe how the colors are built up and how they should be used.

-
Name The first part and the name of the color scale. By default, Designsystemet comes with the color scales Success, Danger, Warning, Info, and Neutral. More scales can be added using the Theme Builder.
-
Group Each color scale is divided into the groups Background, Surface, Border, Text, and Base. These groups describe the areas of use for the colors. For example, the Text group should be used for text and icons.
- Variant Within each group, there are variants that describe how the colors look or should be used. For example, Tinted means the color has a hint of color in it, while Hover means the color is intended to be used for an interactive state.
Contrast
By default, the semantic colors are designed to meet contrast requirements, regardless of which base color you have chosen. This applies in particular to text colors against background and surface colors.
The "Minimum contrast" column in the table of colors shows the minimum contrast each color has, and against which other colors in the same color scale.
You have to check the contrast of base-default yourself
base-default is an exception. In light mode, it is always the same as the color you selected, to preserve your brand as accurately as possible.
We therefore can't guarantee that it has sufficient contrast against the background it is placed on.
base-default is used semantically to show state, for example as the fill color of an active switch or a checked checkbox.
The color then needs a contrast of at least 3:1 against the background or surface color it is placed on, as required by 1.4.11 Non-text Contrast (w3.org).
The Theme Builder checks this for you. Under "Contrasts between colours" you can see the contrast between base-default and the background and surface colors.
If you already have a theme, you can import your config file in the Theme Builder and have the contrasts checked there.
Light and dark mode
This section describes how the colors are generated by default. You can override individual colors for light and dark mode, and you then have to make sure yourself that they work and have sufficient contrast.
The steps in a color scale have the same names and the same roles in both light and dark mode. Only the color values behind the tokens change. This makes it possible to switch between light and dark mode without having to change colors in the design, and it makes it easier to build components that work in both modes.
The colors are also designed to follow the same contrast principles in both modes. The goal is that you can use Background, Surface, Border and Text in the same way, whether the interface is light or dark. Base is the most important exception, and is therefore covered separately.
In dark mode, the colors are also slightly reduced in saturation so that they work better on dark surfaces.
Background and Surface in light and dark mode
In light mode, both background-default and surface-default are white, regardless of which color scale you use.
This makes it possible to have white surfaces, such as cards and panels, on top of a white background.
In dark mode, neither the background nor the surfaces are completely black. Instead, the Background and Surface colors get their hue from the scale generated from the selected Base color. The Surface colors are lighter than Background, so that they can build up depth and hierarchy above the background. This is especially important in dark mode, because differences between background and surfaces are used to a greater extent to create depth and clear hierarchy.
A color scale therefore has several Background and Surface colors. They cover different needs in light mode, while also providing clear and even transitions in dark mode.
The Base colors behave slightly differently
base-default is based on the color selected in the Theme Builder.
In light mode, this color is used directly, while in dark mode it is adjusted automatically to work better on dark surfaces.
See also the pages on Colors in code and Modes in Figma for how to switch between light and dark mode in practice.
All colors in a color scale
Each color scale consists of a total of 16 colors, designed to cover different needs in the design. The table shows what each color is used for, and the minimum contrast it has against other colors in the same color scale.
| Name | Usage | Minimum contrast |
|---|---|---|
| background-default | Default background color. | – |
| background-tinted | Background with a hint of color. | – |
| surface-default | Default color for surfaces / components. | – |
| surface-tinted | Surfaces / components with a hint of color. | – |
| surface-hover | Hover color for surfaces / components. | – |
| surface-active | Active color for surfaces / components. | – |
| border-subtle | Border color with low contrast for decorative use (dividers). | – |
| border-default | Default border color for form components and meaningful elements. | 3:1 against all background colors, |
| border-strong | Border color with high contrast for extra visibility. | 3:1 against all background colors and all surface colors |
| text-subtle | Text and icon color with lower contrast. | 4.5:1 against all background colors, |
| text-default | Text and icon color with high contrast and good visibility. | 4.5:1 against all background colors and all surface colors |
| base-default | Default color for solid backgrounds. | – |
| base-hover | Hover color for solid backgrounds. | – |
| base-active | Active color for solid backgrounds. | – |
| base-contrast-subtle | Color with good contrast against Base-default. | 4.5:1 against |
| base-contrast-default | Color with good contrast against Base-default and Base-hover. | 4.5:1 against |
How to use the colors
The colors are divided into the groups Background, Surface, Border, Text and Base. Below you'll find more about each group and when to use the different colors.

Background
Background colors are used to color large surfaces and are often the back layer on a website. It's common to use these colors on the body element.
background-defaultis the lightest and most neutral background color.background-tintedgets a hint of color in it and can be used to create variation in the background layer.
Surface
Surface colors are used to color elements that sit above the background colors, such as panels or cards.
These colors serve as foreground colors and help create depth in the design by separating elements from the background.
In dark mode, these four colors become gradually lighter, with surface-active being the lightest.
surface-defaultis completely white in light mode and is used as the standard background color for elements.surface-tintedgets a hint of color in it and can be used to distinguish elements from the background.surface-hovercan be used for hover states for elements or to create visual hierarchies in the Surface layer when combined withsurface-tintedandsurface-active.surface-activecan be used for active states for elements or to strengthen the hierarchy in the Surface layer together withsurface-tintedandsurface-hover.
surface-tintedBorder
Border colors are used to color frames (strokes) of elements.
border-subtlehas low contrast against background and surface colors and should only be used for decorative purposes. Common use cases are dividing lines and decorative frames. The color should not be the only visual indicator that an element is interactive.border-defaultis used on form components or on other meaningful frames.border-stronghas higher contrast thanborder-defaultand can be used on frames to make elements extra visible.
border-subtleborder-defaultText
Text colors are used for text and icons.
text-subtleis a light text color that can be used to create variation in typography or to indicate hierarchical levels of importance. It also tries to preserve as much of the color saturation from the original color chosen in the Theme Builder.text-defaultis a text color with high contrast, optimal for readability. It should be used for the main content and the primary text on a page. This color in the Neutral variant can be a nice color to use for most of the text.
text-defaulttext-subtleBase
Base colors are used to color solid backgrounds, such as buttons and other interactive elements. The colors help direct attention to important design elements and establish a visual hierarchy in relation to less prominent elements. At the same time, they create contrast against background and surface colors, which enhances readability and visual clarity.
The base-hover and base-active colors are generated based on the lightness or darkness of the base-default color to create smooth visual transitions between states.
base-contrast-default becomes either white or black, depending on which gives the best contrast against the base colors. base-contrast-subtle goes in the same direction.
base-defaultcan be used to color solid backgrounds of elements. The color (hex code) chosen in the theme builder is placed underbase-default.base-hovercan be used for hover states for solid elements or to create visual hierarchies in the Base layer when combined withbase-defaultandbase-active.base-activecan be used for active states for solid elements or to strengthen the hierarchy in the Base layer together withbase-defaultandbase-hover.base-contrast-subtleandbase-contrast-defaultare used as text and icon colors on top of the base colors from the same color scale. See the "Minimum contrast" column in the table above for which base colors they can be used on.
base-defaultTo better understand how the colors work, you can see how different color scales look in the Designsystemet Theme Builder.
Edit this page on github.com (opens in a new tab)