Box-shadow
Shadow (shorthand)
Shadows are used to show depth on the surface of a page. Borders are used alongside shadows to further emphasize the edge of a shape, especially in dark mode, where shadows are far more subtle.
The "light source" for these shadows is oriented between the top and center of the object which has the shadow applied. There are two levels of shadows in Codex represented as small
, medium
, and large
.
- Small should be used for elements which other content disappears behind, and are on the lowest possible elevated plane, such as ProgressBars, toolbars, and collapsed headers.
- Medium should be used for elements which appear overtop of other content, but are triggered from a directly related element on the page, such as Menus.
- Large should be used for elements which appear overtop of an entire page or surface area, or require extra attention, such as Dialogs, Toasts, previews, and bottom sheets.
Shadow levels should not change when a new plane is created. For example, a Menu which appears within a Dialog should still have a medium
box-shadow.
Name | Value |
---|---|
box-shadow-small | 0 0 0 1px #a2a9b1
|
box-shadow-small-top | 0 -1px 0 0 #a2a9b1
|
box-shadow-small-bottom | 0 1px 0 0 #a2a9b1
|
box-shadow-medium | 0 4px 4px 0 rgba( 0, 0, 0, 0.06 ), 0 0 8px 0 rgba( 0, 0, 0, 0.06 )
|
box-shadow-large | 0 4px 8px 0 rgba( 0, 0, 0, 0.06 ), 0 0 16px 0 rgba( 0, 0, 0, 0.06 )
|
Inset shadow
Name | Value |
---|---|
box-shadow-inset-small | inset 0 0 0 1px
|
box-shadow-inset-medium | inset 0 0 0 2px
|
box-shadow-inset-medium-vertical | inset 0 -2px 0 0
|
Outset shadow
Name | Value |
---|---|
box-shadow-outset-small | 0 0 0 1px
|
box-shadow-outset-small-top | 0 -1px 0 0
|
box-shadow-outset-small-bottom | 0 1px 0 0
|
box-shadow-outset-small-start | -1px 0 0 0
|
box-shadow-outset-medium-below | 0 4px 4px 0
|
box-shadow-outset-medium-around | 0 0 8px 0
|
box-shadow-outset-large-below | 0 4px 8px 0
|
box-shadow-outset-large-around | 0 0 16px 0
|
Box-shadow color
Name | Value |
---|---|
box-shadow-color-base | #a2a9b1
|
box-shadow-color-progressive--active | #233566
|
box-shadow-color-progressive--focus | #36c
|
box-shadow-color-progressive-selected | #36c
|
box-shadow-color-progressive-selected--hover | #3056a9
|
box-shadow-color-progressive-selected--active | #233566
|
box-shadow-color-destructive--focus | #36c
|
box-shadow-color-inverted | #fff
|
box-shadow-color-alpha-base | rgba( 0, 0, 0, 0.06 )
|
box-shadow-color-transparent | transparent
|
Drop shadow (deprecated)
Drop shadows are deprecated, and shadow shorthands should be used instead.
Name | Value |
---|---|
box-shadow-drop-small | 0 0 0 1px #a2a9b1
|
box-shadow-drop-medium | 0 4px 4px 0 rgba( 0, 0, 0, 0.06 ), 0 0 8px 0 rgba( 0, 0, 0, 0.06 )
|
box-shadow-drop-xx-large | 0 20px 48px 0 rgba( 0, 0, 0, 0.2 )
|