Elevation

Paper cards with one grey frame line on a fog canvas; controls sit a pixel above the page, overlays lift with one short shadow.

Rules

  1. elevation-overlay-shell MUST A dialog or sheet is a grey shell with the overlay shadow holding one white card 4px in, with the title, description, close and body in it; the actions sit on the grey. Because the shadow lifts the overlay, and the grey shell with its one white card tells the person where the content is and where the actions are.
    • Correct: <DialogContent><DialogHeader/><DialogBody><Field/></DialogBody><DialogFooter/></DialogContent>
    • Wrong: <DialogContent><DialogHeader/><Field/><DialogFooter/></DialogContent>
  2. elevation-overlays-only MUST Shadow only overlays: menus, popovers, dialogs, sheets, the command palette, tooltips and toasts. Because a shadow says this floats above the page, and a shadowed card makes the person look for what it covers.
    • Correct: <DropdownMenuContent/> // shadow-overlay
    • Wrong: <Card className="shadow-md"/>
  3. elevation-one-shadow MUST Use shadow-overlay for every overlay; never write a shadow value. Its 1px frame line is part of shadow-overlay, so an overlay never adds frame. Because a written value keeps its light-theme strength in the dark theme, and frame inside a scrolling overlay scrolls away with the content.
    • Correct: <div className="shadow-overlay">
    • Wrong: <div className="shadow-[0_8px_24px_#0003]">
  4. elevation-no-glass NEVER Blur or fade an overlay; use solid paper. Because the page shows through a translucent surface and pulls the menu text under its contrast floor.
    • Correct: <div className="bg-page shadow-overlay">
    • Wrong: <PopoverContent className="bg-raised/70 backdrop-blur-md">
  5. elevation-well-not-container NEVER Use the grey field as a container; it is a well for code, output and read-only values inside a frame. Because a grey slab around a heading or a button is the box-in-a-box the frame replaces, and on paper it has no edge.
    • Correct: <div className="frame"><pre className="well px-4 py-3">…</pre></div>
    • Wrong: <div className="bg-surface p-4"><h3>Runs</h3><Button/></div>
  6. elevation-dialog-scrim SHOULD Dim the page behind a dialog with --surface-overlay. Because the scrim tells the person the page is inert until the dialog closes.
  7. elevation-no-xs-sm NEVER Use shadow-xs or shadow-sm; both are empty in Quartz. Because they draw nothing, so a model that reaches for them to lift a card ships a flat card and thinks it is raised.
    • Correct: <Card/>
    • Wrong: <Card className="shadow-sm"/>

Tokens

TokenRoleUse forNot forLightDark (blank: same as light)
--inksolid inkprimary text, primary buttonoklch(var(--ink-c))
--papersolid paperpage backgroundoklch(var(--paper-c))
--surface-canvasthe cool fog an app sits on, behind its cards and framesapp background, docs previewoklch(var(--canvas-c))
--surface-pagepaper: the ground of every card, frame and panelcard, table, dialogvar(--paper)
--surface-cardthe well: the grey field inside a frame for code, logs, shell output and read-only values; never a containercode, output and read-only values inside a framecontainersoklch(var(--grey-c))
--surface-framea panel's outer frame: lighter than the well, so a page of panels stays brightpanel, overlay shellcolor-mix(in oklch, var(--surface-card) 55%, var(--paper))
--surface-raiseda container inside a grey cardpaper; a container inside a grey cardQuartz overlays, which use papervar(--paper)
--surface-hoverrow and item hoverrow, menu item, ghost buttonoklch(var(--ink-c) / 0.05)
--surface-selectedselected row with no kind, one step past hovertable, data table, treeoklch(var(--ink-c) / 0.09)
--surface-pressedactive pressrow, ghost buttonoklch(var(--ink-c) / 0.08)oklch(var(--ink-c) / 0.28)
--surface-inversea pressed chip or highlighted item on the page's own channels; whole panels use data-surface="inverse"chip, segmented controlvar(--ink)
--surface-tilea media square behind an image or file icon, ink at 8%attachment mediaoklch(var(--ink-c) / 0.08)
--surface-overlaydialog backdropdialog and sheet backdroppopoversoklch(var(--ink-c) / 0.24)
--surface-thumbthe selected segment: paper on the grey track in light, paper mixed with ink in dark so it reads lighter than the tracksegmented controlcolor-mix(in oklch, var(--paper), oklch(var(--ink-c)) var(--thumb-lift))
--focus-haloa field with the cursor: a soft ink halo around its ink edge, eased ininput, select, combobox, date picker, OTP, code editor, composer0 0 0 3px oklch(var(--ink-c) / 0.08)
--elev-controlthe lift under a paper control, so a button or field sits on the page instead of being drawn on ita one-pixel drop under a paper control, so a secondary button, field or select sits on the pagecards, rows0 1px 2px -1px oklch(var(--text-on-field-c) / calc(var(--shadow-alpha) * 0.6))
--elev-noneno lift, for a control that sits flat: disabled and read-only fieldsfield, select, checkbox, radio, switch, otp0 0 0 0 transparent
--elev-thumbthe selected segment lifted off its grey track; in dark a 1px ring joins the shadowa small shadow, plus a faint ring in the dark theme, that lifts the selected segment off its grey trackcards and overlays0 0 0 1px oklch(var(--ink-c) / var(--thumb-ring-alpha)), 0 1px 2px oklch(var(--text-on-field-c) / calc(var(--shadow-alpha) * 0.5))
--elev-overlaythe overlay's edge plus one short shadow1px frame line plus one short shadow: menu, popover, dialog, sheet, tooltip, toastcards0 0 0 1px var(--line-frame), 0 12px 24px -12px oklch(var(--text-on-field-c) / var(--shadow-alpha))
--shadow-alphaoverlay shadow strength; the dark theme raises itoverlay shadow, raised in the dark themecomponents0.200.6

Ink and paper tokens

Read only through their classes; never set or read them in a component. --ink-c, --paper-c, --grey-c, --canvas-c, --text-on-field-c, --shadow-alpha

Decision table

You needUse
Card, panel, tablethe frame line, no shadow
Code or output inside a framewell (--surface-card)
Menu, popover, tooltip, toast--elev-overlay
Dialog or sheet--elev-overlay and --surface-overlay behind

Scale

Three levels: flow (a frame on paper), well (grey inside a frame, no line), overlay (frame line and one shadow). The segmented control's thumb is the one smaller lift, --elev-thumb.

Reject list

  • No colored shadows, gradients or backdrop blur.
  • No grey slab as a container.
  • Borders and lines: Grey fields keep things apart, and hairlines go only where a field cannot.
  • Color: Five hues name the kind of thing, and amber and red mean trouble.