Foundations
Elevation and shape
Four surface levels, radii that follow size, two stroke widths and short motion.
Four levels
Levels 2 and 3 float over content. Never skip a level, and never nest a surface inside one of the same level.
| Level | Use for | Light | Dark |
|---|---|---|---|
| 0 Canvas | The page. | #fdfdfd | #151515 |
| 1 Raised | Panels, table and chart frames, stat strips, current nav item, top bar. | White, hairline, 0 0 2px and 0 2px 4px at 8% ink | #1c1c1c, hairline, lit top edge; fields #2c2c2c |
| 2 Overlay | Menus, popovers, toasts, chart readouts. | White, hairline, 0 0 2px at 12%, 0 8px 16px at 14% ink | #333333, hairline, lit top edge, heavier shadow |
| 3 Modal | Dialogs, over a scrim. | White, hairline, 0 0 8px at 12%, 0 32px 64px at 20% ink; 56% scrim | Two steps lighter, hairline; 72% scrim |
Shape
The radius follows the element's size. Nested corners stay concentric: the outer radius is the inner radius plus the gap. Where the browser supports it (Chrome), corners are continuous, as on iPhone.
| Radius | Use for |
|---|---|
| 3px | Marks 24px and under: tags, kbd, checkboxes, inline code; hover shapes of tabs, nav and menu items. |
| 4px | Buttons, inputs, selects, tooltips, the segmented thumb. |
| 6px | The segmented track. |
| 8px | Menus, popovers, toasts, banners, chart readouts, message bubbles; panels, cards, table and chart frames, stat strips, dialogs, drawers, code blocks. |
| 12px | The composer only. |
| Full | Status dots, avatars, switches, meter tracks. Never anything with a label. |
One surface per region
Tables, charts and stat strips are surfaces, so they sit on the canvas, not in a panel. Feedback surfaces add only a leading status bar.
Open requests
4 need review today.
Open requests
4 need review today.
Strokes
Borders are 1px. Tab and nav location markers and the focus ring are 2px. Never 3px or half a pixel.
Motion
Motion only confirms a change. It lasts 240ms at most, 320ms for large panels, and turns off under reduced motion. Slow motion, in the header, plays it at a quarter speed.
If your system is set to reduce motion, the square jumps: that is the tokens resolving to 0ms, not a bug.
Rules
Every component follows these. Follow them in anything you add.
| Rule | Value | See it |
|---|---|---|
| Things that appear start fast and settle. | Ease out, --sg-motion-easing-enter | Menu |
| Things that leave speed up, and take 20% less time than they took to come. | Ease in, --sg-motion-easing-exit. A menu opens in 160ms and closes in 128ms. | Menu |
| Things that move between two places speed up, then slow down. | Ease in and out, --sg-motion-easing-move | Switch |
| A menu or popover grows out of its trigger and shrinks back toward it. | Opens from 90% of its size, closes to 95% | Menu |
| A pressed control answers on the press itself. | Scale 0.995, no delay | Button |
| A held switch thumb stretches toward where it will go. | 12% wider | Switch |
| What you drag follows the pointer exactly, and animates only when let go. | No easing while held | Drawer |
| Dragged past where it can go, it resists more and more. | A rubber band that tops out at a tenth of its width | Toast |
| A list that arrives for the first time comes in row by row. | 30ms apart, the first ten rows. Never on sort or filter. | Below |
| New content fades in where the old content was. | 160ms | Tabs |
| An icon that changes crossfades into the next. | The old one shrinks, fades and blurs out in 160ms | Copy, on this site |
| An object that travels across the screen follows an arc. | The move curve | |
| A finished action shows that it worked before its panel closes. | A check and "Saved" for 600ms | Busy button |
| A control keeps its size when its label changes. | Its labels share one cell | Busy button |
| A new action takes over a running animation from where it is. | Transitions, never keyframes, for state | Drawer |
| Everyday motion never overshoots or bounces. | No springs |
A list's first load
Animate
- Hover, press and focus color and border: 100ms.
- Menus, tabs and disclosure: 160ms.
- Dialogs and scrims: 240ms.
- Drawers and large panels: up to 320ms.
- Meter fills, and looping live activity: loader, typing, recording.
Do not animate
- Pulsing, bouncing, shimmering or marquee.
- Layout.
- Page transitions.
- Data changing in a table, beyond a brief tint on the changed cell.
- A list that is sorted or filtered.
Layers
Dialogs and popovers use the top layer and need no z-index. Everything else that stacks uses these tokens.
| Token | Value | Use for |
|---|---|---|
--sg-layer-sticky | 100 | Sticky table headers and bars. |
--sg-layer-overlay | 200 | Overlays outside the top layer, such as the chart readout. |
--sg-layer-toast | 300 | The toast region, above sticky bars. |
--sg-layer-tooltip | 400 | Tooltips, topmost. |