Brand Guide

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.

Shadows

Every step starts with the hairline drawn inside, then adds soft layers of --shadow-color at 2 to 6%, lit from above.

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

Edge shadows

For a bar or panel pinned to an edge of the screen, such as the mobile nav as it slides back in: shadow-md's soft layers, cast from one side, with no ring. Each is shadow-edge-b turned round.

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

Hairline

--hairline is 1px, and 0.5px on retina screens: one device pixel either way. Nothing is thicker, except a focus or selection ring.
border-hairlineA border: the key cap
shadow-xsAn edge drawn inside, so it adds no width
h-(--hairline)A divider: menu separators

In components

The key cap has a hairline border. The menu has the overlay shadow, whose hairline is its only edge, and a hairline separator.
CommandK

Rules

  • A shadow says how far a surface is lifted off the page: sm for a card, md for something pinned over the page, lg for 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-lg and no border.
  • For an edge with no lift, use shadow-xs or border-hairline. shadow-xs is 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.