Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions src/docs/foundation/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<div>
<rui-swatch color="action-primary"></rui-swatch>
<rui-swatch color="action-primary-hover"></rui-swatch>
Expand All @@ -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`.

<div>
<rui-swatch color="feedback-success"></rui-swatch>
<rui-swatch color="feedback-success-hover"></rui-swatch>
Expand Down Expand Up @@ -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.

<div>
<rui-swatch color="state-valid"></rui-swatch>
<rui-swatch color="state-valid-hover"></rui-swatch>
Expand Down Expand Up @@ -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`.

<div>
<rui-swatch color="neutral-light"></rui-swatch>
<rui-swatch color="neutral-light-hover"></rui-swatch>
Expand All @@ -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` +
Expand Down Expand Up @@ -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`.

<div>
<rui-swatch color="background-primary"></rui-swatch>
Expand All @@ -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).

<div>
<rui-swatch color="background-success"></rui-swatch>
Expand All @@ -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.

<div>
<rui-swatch color="background-state-valid"></rui-swatch>
Expand Down
Loading