From d85a603dd5ba286af77608363234c704a9fd0d20 Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Mon, 30 Nov 2026 18:52:16 +0100 Subject: [PATCH] =?UTF-8?q?Clarify=20Foundation=20=E2=80=BA=20Colors=20doc?= =?UTF-8?q?s=20(#793)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/docs/foundation/colors.md | 41 +++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/src/docs/foundation/colors.md b/src/docs/foundation/colors.md index ec5e527f..a3e1a01e 100644 --- a/src/docs/foundation/colors.md +++ b/src/docs/foundation/colors.md @@ -55,6 +55,9 @@ Action colors communicate the **importance** of an action which can be primary or secondary. Using the _selected_ color, you can also mark an action as the currently selected. +Use the `on-*` color for text and icons placed on an action color, e.g. +`action-on-primary` on `action-primary`. +
@@ -80,6 +83,9 @@ Feedback colors help communicate a meaning: green means success, orange means warning, and red means danger or error. On top of that, there are a few more feedback colors to fit various design situations. +Use the `on-*` color for text and icons placed on a feedback color, e.g. +`feedback-on-success` on `feedback-success`. +
@@ -124,6 +130,11 @@ form fields. Valid, warning, and invalid states look like the success, warning, and danger feedback colors by default, but they are separate and can be customized independently. The changed state has a color of its own. +State colors are meant for borders, for text on the surrounding +[content layer](#content-layers), and for checked checkboxes, radios, and +toggles. Form fields use them this way for their border, label, and help text. +They are not meant as fills for text, so they have no `on-*` colors. +
@@ -151,6 +162,9 @@ Neutral colors are intended for neutral variants of components that support colors. The light color works well with dark backgrounds. Conversely, the dark color stands out on light backgrounds. +Use the `on-*` color for text and icons placed on a neutral color: +`neutral-on-light` on `neutral-light` and `neutral-on-dark` on `neutral-dark`. +
@@ -170,7 +184,16 @@ Colors reserved for backgrounds. ### Content Layers -Backgrounds for the fundamental UI areas and content layering. +Backgrounds for the fundamental UI areas and content layering: + +- `background-base` for the bottom-most layer of your UI, +- `background-layer-1` for regular content, e.g. [Card](/components/Card), + [Paper](/components/Paper), and [Tabs](/components/Tabs), +- `background-layer-2` for overlays, e.g. [Modal](/components/Modal) and + [Popover](/components/Popover). + +Layers 1 and 2 can share a color in a light theme, but keep them apart: a dark +theme needs them to differ. 👉 Content layers can be separated from background using their [shadow counterparts](/docs/foundation/shadows): `background-layer-1` + @@ -210,7 +233,9 @@ does not stand in the way of the underlying component background. ### Action Backgrounds -Backgrounds for areas with actionable content. +Light tints of the [action colors](#action-colors). Flat +[Buttons](/components/Button) use them on hover and when pressed, and selected +Buttons use `background-selected`.
@@ -220,7 +245,9 @@ Backgrounds for areas with actionable content. ### Feedback Backgrounds -Backgrounds for feedback areas. +Backgrounds for feedback surfaces, such as [Alert](/components/Alert), +[Modal](/components/Modal), and flat [Buttons](/components/Button) on hover and +when pressed. Pair them with [feedback colors](#feedback-colors).
@@ -233,7 +260,13 @@ Backgrounds for feedback areas. ### State Backgrounds -Backgrounds for form fields in individual states. +Backgrounds for components whose data is in a +[state](collections.md#states), such as form fields. Pair them with +[state colors](#state-colors). + +💡 State backgrounds may match feedback backgrounds, e.g. +`background-state-valid` and `background-success`, but they are separate so +you can customize states independently of feedback.