Opacity
You might say
This image is stealing too much attention. Make it a little transparent.
Make an element and its contents more transparentOpacity changes the transparency of an entire element, including its children. It can soften secondary or disabled content, but low opacity also reduces text contrast. Use a transparent color when only the background should fade.
When to use it
- Soften a disabled visual stateAvailableDisabled
- Fade an element during a transition→
- Create a subtle overlayDialog
- Reduce the emphasis of decorative content
When NOT to use it
- Lower body-text contrast until it is hard to readopacity .4rgba .4
- Use opacity when only the background should changeBody text is too transparent, so its contrast is too low.
- Hide content visually while leaving an unexpected click targetThis opacity: 0 button is still clickable.
- Use transparency as the only sign that a control is disabledOpacity compounds across layers, making the resulting color harder to predict.
Anatomy
opacity: 0.45Background shines through
something seen through
If opacity is less than 1, the overall color becomes lighter.
The lower the transparency, the more the background shows through
Variants
0.4
Disable
Unclickable buttons and input boxes
0.8
hover
Secondary icons are usually lighter
0.5
Mask
Darken the page behind the pop-up window
0
0
Use placeholder when doing fade-in animation
Typical use cases
Disabled state
opacity: 0.4 = disabled
Fade transition
Design specification.md
✎
⧉
★
The secondary icon usually has an opacity of 0.45, and the hovered one returns to 1
Overlay
Decorative image
Copied link
→
Copied link
→
Copied link
transition: opacity .2s, fade in
Further reading
