Skip to content

System colors: from Windows 95 to forced colors

CSS has a set of color keywords that ask the browser for a color instead of naming one: Canvas, ButtonText, Highlight and their siblings. They started as a copy of the Windows 95 color settings, spent sixteen years deprecated, and came back as the vocabulary for Windows contrast themes.

Where system colors came from

Before CSS, each browser decided how a page looked. The first one, Tim Berners-Lee's WorldWideWeb on NeXT, drew documents from a style sheet the reader could open, edit and save, but the format was never published. Authors had no way to send styles with a page.

The WorldWideWeb browser's Style menu, listing named styles such as Normal and Heading 1, beside its Style Editor panel. The panel has a Style sheet box with Open and Save as buttons, and format fields for indents, font, font size and an SGML tag set to P.
The Style Editor in WorldWideWeb. A reader opened or saved a style sheet from the box at top right. Each named style set indents, a font and a size, and was tied to a tag (here <P>), the job a CSS rule does today. Captured from CERN's rebuild of the browser.[1]

Between CSS2's 28 keywords and their deprecation, there was a much bigger plan. The User Interface for CSS3 working draft of 16 February 2000 gave every user interface element a background, a text color and a border, then multiplied each by four states. It added up to 210 keywords.

Deep dive the 210 system colors proposed in 2000

The draft named 14 elements. Five were generic and every browser had to support them: icon, window, button, menu and field. The other nine were more specific versions of those five, and a browser could fall back to the generic one. Picking a state below shows how the draft built each state's names, by putting the state in front of the name.

Show the names for a state
  • Still a CSS keyword today
  • A deprecated CSS2 keyword browsers still accept
  • No mark: never shipped
14 elements, 3 colors each, in 5 versions: one for no state and one for each of the 4 states. Swatches are painted with today's keyword, so they show your browser's current value.
ElementBackgroundTextBorder
iconIconIconTextIconBorder
windowWindowdeprecated keywordWindowTextdeprecated keywordWindowBorder
document, falls back to windowDocumentDocumentTextDocumentBorder
workspace, falls back to windowWorkspaceWorkspaceTextWorkspaceBorder
desktop, falls back to windowDesktopDesktopTextDesktopBorder
tooltip“info” in CSS2, falls back to windowInfoInfoTextdeprecated keywordInfoBorder
dialog, falls back to windowDialogDialogTextDialogBorder
buttonButtonButtonTextcurrent keywordButtonBordercurrent keyword
default button, falls back to buttonDefaultButtonDefaultButtonTextDefaultButtonBorder
menuMenudeprecated keywordMenuTextdeprecated keywordMenuBorder
pull-down menu, falls back to menuPullDownMenuPullDownMenuTextPullDownMenuBorder
popup menu, falls back to menuPopupMenuPopupMenuTextPopupMenuBorder
list, falls back to menuListListTextListBorder
fieldFieldcurrent keywordFieldTextcurrent keywordFieldBorder

How a browser was meant to fall back

The draft expected that no browser could support all 210, so it gave a lookup order. For the border of a default button being clicked:

  1. ActiveDefaultButtonBorderThe specific element, in its state
  2. ActiveButtonBorderThe generic element, in its state
  3. ButtonBorderThe version with no state

What it might have looked like

The draft never gave the keywords values, but its Appendix A applied them to HTML's own form controls. Those rules are below, painted onto a small dialog of real input and select elements. Windows 2000 reached stores the day after the draft was published, so its default scheme, "Windows Standard", is one way to see what the authors had in front of them. The other is your own browser today, using the keyword CSS kept for each name.

Paint the dialog with
Page properties
Saves the title
A dialog styled with the draft's example rules: a text field, a list, a dropdown, a default submit button (OK), a regular button and a tooltip. The raised and sunken edges in the Windows 2000 version are browser bevels standing in for Windows' 3D borders. The controls are inert, there to look at.
CSS
button, input[type=button], input[type=reset], input[type=submit],input[type=checkbox], input[type=radio], textarea, input, input[type=text],input[type=hidden], input[type=password], input[type=image] {	color: ButtonText; background: Button;	border: ButtonBorder; font: button;}input[type=submit] {	color: DefaultButtonText; background: DefaultButton;	border: DefaultButtonBorder;}textarea, input[type=text], input[type=hidden], input[type=password] {	color: FieldText; background: Field;	border: FieldBorder; font: field;}select[size] {	color: ListText; background: List;	border: ListBorder; font: List;}select,select[size=1] {	color: PopupMenuText; background: PopupMenu;	border: PopupMenuBorder; font: PopupMenu;}

The draft's rules as written, trimmed to the color declarations and the font each set.

Each name the dialog uses. The Windows 2000 values come from a published table of Windows schemes; matching each draft name to a Windows setting is my reading, not the draft's. Title bar and selection colors use CSS2 keywords, since the draft named neither.
Draft nameWindows 2000TodayHow I picked it
DesktopBackgroundCanvasFallback to Window
DialogButtonFaceCanvasFallback to Window
DialogTextWindowTextCanvasTextFallback to Window
FieldWindowFieldSame name
FieldTextWindowTextFieldTextSame name
FieldBorderButtonShadowButtonBorderNearest
ListWindowFieldNearest
ListTextWindowTextFieldTextNearest
PopupMenuWindowFieldNearest
PopupMenuTextWindowTextFieldTextNearest
ButtonButtonFaceButtonFaceNearest
ButtonTextButtonTextButtonTextSame name
ButtonBorderThreeDDarkShadowButtonBorderSame name
DefaultButtonButtonFaceButtonFaceFallback to Button
DefaultButtonTextButtonTextButtonTextFallback to Button
DefaultButtonBorderWindowFrameButtonBorderFallback to Button
InfoInfoBackgroundInfoBackgroundDeprecated CSS2 keyword
InfoTextInfoTextInfoTextDeprecated CSS2 keyword

System colors outside the browser

CSS took its first keywords from one operating system, but every desktop platform keeps its own list of named interface colors. Putting them side by side shows what CSS has and what it's missing. They fall into two naming styles: Windows, KDE and GNOME name a color after the part of the interface it paints, the way CSS does, while Apple names colors by rank.

Windows

The Win32 list behind CSS2 is still there, but current Windows apps use the XAML theme resources. They change with the theme and include SystemAccentColor and a set prefixed SystemColor, such as SystemColorButtonFaceColor. Under a contrast theme, apps get eight system brushes, and Microsoft documents each one with the color it should sit on: SystemColorWindowColor is the background of pages, panes, popups and windows, paired with SystemColorWindowTextColor. Those eight are the slots CSS's Canvas, CanvasText, LinkText, GrayText, Highlight and ButtonFace pairs were built around.

Apple

macOS (AppKit's UI element colors) and iOS (UIKit's) name colors for their job, with ranks inside each job: label through quaternaryLabel for text, systemBackground with secondary and tertiary backgrounds layered on top of it, and fills sized to the shape they fill. WebKit exposes some of these to CSS as -apple-system-label, -apple-system-blue and the like, in Safari only. Apple's Human Interface Guidelines also warn against using the separator color as text, or a secondary label color as a background: the same rule CSS Color 4 gives for its own pairs.

KDE Plasma

KDE's color scheme is the closest living relative of the 2000 draft. It crosses sets (View, Window, Button, Selection, Tooltip, Complementary and Header) with the same roles in every set: normal and alternate backgrounds; normal, active, inactive, link and visited text; focus and hover decorations; and three roles CSS doesn't have, NegativeText, NeutralText and PositiveText. Those three are close to what the open status color proposal asks for, and KDE's own docs suggest them for window buttons: positive for maximize, neutral for minimize, negative for close.

GNOME

libadwaita's named colors come in background and foreground pairs, such as window_bg_color with window_fg_color and view_bg_color with view_fg_color, with the older GTK 3 names kept as aliases. Since libadwaita 1.6 in 2024 they are also real CSS custom properties, --window-bg-color and friends, because GTK's own stylesheets gained CSS variables.

The same parts of an interface, in five vocabularies

Named colors for the same interface parts in CSS, Windows, macOS, KDE and GNOME
PartCSSWindows (WinUI)macOS (AppKit)KDEGNOME
Window backgroundCanvasSystemColorWindowColorwindowBackgroundColorWindow backgroundwindow_bg_color
TextCanvasTextSystemColorWindowTextColorlabelColorWindow normal textwindow_fg_color
Content areaFieldNonecontrolBackgroundColorView backgroundview_bg_color
ButtonButtonFace, ButtonTextSystemColorButtonFaceColor, SystemColorButtonTextColorcontrolColorButton background and textNone
LinkLinkTextSystemColorHotlightColorlinkColorLink textNone
Disabled textGrayTextSystemColorGrayTextColordisabledControlTextColorInactive textinsensitive_fg_color (GTK 3 alias)
SelectionHighlight, HighlightTextSystemColorHighlightColor, SystemColorHighlightTextColorselectedContentBackgroundColorSelection setaccent_bg_color
AccentAccentColorSystemAccentColorcontrolAccentColorAccent coloraccent_bg_color
StatusNone (proposed)NoneFixed hues (systemRed, systemGreen)Negative, neutral, positiveerror_bg_color, warning_bg_color, success_bg_color
Find highlightMark (closest)NonefindHighlightColorNoneNone
Focus ringNone (outline-color: auto)NonekeyboardFocusIndicatorColorFocus decorationNone
Unfocused selectionNoneNoneunemphasizedSelectedContentBackgroundColorWindow set (by convention)theme_unfocused_selected_bg_color (GTK 3 alias)
TooltipInfoBackground (deprecated)NoneNoneTooltip setNone

  1. The screenshot shows a reconstruction, not the original software. CERN rebuilt WorldWideWeb in 2019 to run inside modern browsers, so the fonts and rendering are approximations. CERN's 1993 screenshot shows the browser on a NeXT machine. ↩︎

Contact

A question about a post, a project, or working together — send it here. I try to reply within a couple of weekdays.

Required