Opacity sets how see-through an element is. A faded element lets the background show through, so its colour changes from screen to screen. Beehexa uses opacity in two places only: images inside something turned off, and the scrim behind dialogs.
Why controls use colour
- The background shows through. A faded button looks different on a white card, a yellow banner and a selected row.
- Contrast is no longer checked. A faded colour is a new colour, and text on it may become unreadable.
- Opacity multiplies. A 40% item inside a 40% card ends up at 16%.
The disabled colour tokens, such as color.text.disabled, look the same on every background. See Interaction states.
| I need to | Use |
|---|---|
| Fade a logo, avatar or illustration of something turned off | opacity.disabled (0.4) on the image |
| Turn off a button, input, text or icon | The disabled colour tokens |
| Dim the page behind a dialog or drawer | color.surface.scrim |
| Fade something in or out | Opacity 0 and 1 in an animation, see Motion |
Images that are turned off
Images have their own colours, so no colour token can change them. Fade the image; give the text color.text.disabled; keep the card’s border. Always say “Turned off” in words as well.
The scrim
The scrim dims the page behind a dialog or drawer, so the dialog is the focus and the page reads as unavailable. It is a colour with transparency built in: graphite at 40% in light mode, black at 60% in dark mode, where a dark page needs more to dim. Use it as it is.
Do and don’t
Fade the logo only. The card keeps its border, and the text uses the disabled colour.
Don’t fade the whole card. Its border and text fade too, and the page shows through.
Turn a control off with the disabled colours. It looks the same on any background.
Don’t fade a control with opacity. The background shows through, and the text loses contrast.
Tokens
| Token | Value | Description |
|---|---|---|
--bh-opacity-disabled | 0.4 | Images, logos, avatars and illustrations inside something that is turned off. Never for buttons, inputs, text or icons: they use the disabled colour tokens. |
Related
- Interaction states: how controls show disabled and other states with colour.
- Elevation: dialogs and drawers above the scrim.
- Motion: fading things in and out.