CSS <system-color> Data Type
The <system-color> data type is a color keyword set by the browser or operating system, such as Canvas, CanvasText or ButtonFace, often used in forced colors mode.
Description
The <system-color> CSS data type represents a set of color keywords whose actual values come from the browser and operating system rather than from your stylesheet. Each keyword describes the role of a color, such as the page background (Canvas), normal text (CanvasText), links (LinkText) or the colors of buttons and selected text. A <system-color> can be used anywhere a <color> is accepted, including color, background-color and border-color.
System colors are most important for accessibility. When a user turns on a forced colors mode, such as Windows High Contrast (now called contrast themes), the browser replaces author colors with the user's chosen palette. In that situation, the system color keywords are the way to refer to the user's colors, typically inside a @media (forced-colors: active) block, so that custom controls remain visible and understandable. They also adapt automatically to light and dark themes when used together with the color-scheme property.
The keywords are case-insensitive, though they are usually written in CamelCase, for example ButtonFace. The current list is defined in CSS Color Module Level 4. Older keywords from CSS 2, such as ActiveBorder, ButtonShadow, InfoBackground and Window, are deprecated; browsers still accept them but map them to one of the current keywords, so they should not be used in new code.
Examples:
/* A custom button that matches native controls */
.button {
background-color: ButtonFace;
color: ButtonText;
border: 1px solid ButtonBorder;
}
/* Keep a custom focus ring visible in forced colors mode */
@media (forced-colors: active) {
.card:focus-visible {
outline: 3px solid Highlight;
}
.icon {
fill: CanvasText;
}
}
/* Follow the user's light or dark theme */
:root {
color-scheme: light dark;
background-color: Canvas;
color: CanvasText;
}
Using <system-color> keywords lets your design blend with the user's environment and respect their accessibility settings.
Interactive Demo
Syntax
<system-color> = AccentColor | AccentColorText | ActiveText | ButtonBorder | ButtonFace | ButtonText | Canvas | CanvasText | Field | FieldText | GrayText | Highlight | HighlightText | LinkText | Mark | MarkText | SelectedItem | SelectedItemText | VisitedText
Values
- AccentColorBackground of accented user interface controls.
- AccentColorTextText of accented user interface controls.
- ActiveTextText of active links.
- ButtonBorderBase border color of controls.
- ButtonFaceBackground color of controls.
- ButtonTextText color of controls.
- CanvasBackground of application content or documents.
- CanvasTextText color in application content or documents.
- FieldBackground of input fields.
- FieldTextText in input fields.
- GrayTextText color for disabled items, such as a disabled control.
- HighlightBackground of selected items.
- HighlightTextText color of selected items.
- LinkTextText of non-active, non-visited links.
- MarkBackground of text that has been specially marked, such as with the HTML mark element.
- MarkTextText that has been specially marked, such as with the HTML mark element.
- SelectedItemBackground of selected items, for example a selected checkbox.
- SelectedItemTextText of selected items.
- VisitedTextText of visited links.
Example
Browser Support
The following information will show you the current browser support for the CSS system-color data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





