Components
Shadows and hairline
Four steps of shadow for surfaces that sit above the page, four edge shadows for bars pinned to the screen, and the one line width used for every edge and divider.
Light
shadow-xsThe hairline alone, drawn inside: an edge that adds no width
shadow-smOne step up the surface stack: cards, the app panel, notices
shadow-mdFloating over the page: the composer, pinned pills and buttons
shadow-lgOverlays: menus, popovers, selects, dialogs
Dark
shadow-xsThe hairline alone, drawn inside: an edge that adds no width
shadow-smOne step up the surface stack: cards, the app panel, notices
shadow-mdFloating over the page: the composer, pinned pills and buttons
shadow-lgOverlays: menus, popovers, selects, dialogs
Light
shadow-edge-bFalls below: a bar pinned to the top, the mobile nav
shadow-edge-tFalls above: a bar pinned to the bottom
shadow-edge-rFalls to the right: a panel pinned to the left
shadow-edge-lFalls to the left: a panel pinned to the right
Dark
shadow-edge-bFalls below: a bar pinned to the top, the mobile nav
shadow-edge-tFalls above: a bar pinned to the bottom
shadow-edge-rFalls to the right: a panel pinned to the left
shadow-edge-lFalls to the left: a panel pinned to the right
border-hairlineA border: the key cap
shadow-xsAn edge drawn inside, so it adds no width
h-(--hairline)A divider: menu separators
CommandK
- A shadow says how far a surface is lifted off the page:
smfor a card,mdfor something pinned over the page,lgfor an overlay. - Every step includes the hairline edge, so a surface with a shadow needs no border as well. Menus, popovers, selects and dialogs have
shadow-lgand no border. - For an edge with no lift, use
shadow-xsorborder-hairline.shadow-xsis drawn inside the box, so adding it does not change the box's size. - A bar or panel pinned to an edge of the screen takes the
shadow-edge-*that falls away from that edge, and a hairline border on its inner side only. The steps' ring would outline the sides that touch the screen. - Never write a drop shadow by hand. If no token fits, propose a new one. A ring with no blur that draws an edge or a state, such as a focus line, is a border: write it by hand, with its colour from a token.
- The scale and the line width are the same in light and dark, and live in
packages/shared/styles/tokens.css.