Favorites

CSS <system-color> Data Type

<system-color>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

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.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

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

System colours
Demo Code
HTML Code
<div class="demo-element">System colours</div>
CSS Code
.demo-element {
	width: 260px;
	padding: 18px;
	border: 2px solid #c5c5c5;
	border-radius: 8px;
	font-size: 16px;
	font-weight: bold;
	background: Canvas;
	color: CanvasText;
}

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

<div class="wrap">
<h1>CSS &lt;system-color&gt; examples</h1>
<div class="grid">
<div class="swatch accent"><i></i>AccentColor</div>
<div class="swatch button-face"><i></i>ButtonFace</div>
<div class="swatch button-text"><i></i>ButtonText</div>
<div class="swatch canvas"><i></i>Canvas</div>
<div class="swatch canvas-text"><i></i>CanvasText</div>
<div class="swatch field"><i></i>Field</div>
<div class="swatch gray-text"><i></i>GrayText</div>
<div class="swatch highlight"><i></i>Highlight</div>
<div class="swatch link-text"><i></i>LinkText</div>
<div class="swatch mark"><i></i>Mark</div>
<div class="swatch visited-text"><i></i>VisitedText</div>
</div>
<button class="demo-button">Button using system colors</button>
</div>
/* Displays a swatch for each  keyword */
:root {
  color-scheme: light dark;
}

* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: Canvas;
  color: CanvasText;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid GrayText;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
}

.swatch i {
  flex: 0 0 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid GrayText;
}

.accent i { background: AccentColor; }
.button-face i { background: ButtonFace; }
.button-text i { background: ButtonText; }
.canvas i { background: Canvas; }
.canvas-text i { background: CanvasText; }
.field i { background: Field; }
.gray-text i { background: GrayText; }
.highlight i { background: Highlight; }
.link-text i { background: LinkText; }
.mark i { background: Mark; }
.visited-text i { background: VisitedText; }

.demo-button {
  margin-top: 18px;
  padding: 8px 16px;
  background: ButtonFace;
  color: ButtonText;
  border: 1px solid ButtonBorder;
  border-radius: 6px;
  font: inherit;
}
Open in editor

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.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.