Dark mode

Spacing is an important — and often overlooked — part of product design. Zeta provides tokens and other principles to take the guesswork out of spacing and help deliver clear, functional layouts.

Empty space — also known as white space — is important in design. It can be used to break up sections on a page or to help create focus on certain element(s). White space helps with information processing; too much dense information can be disorienting or overwhelming for a user. Sections of a UI are allowed to be dense, but the whole page should not be crowded; there should be white space to let the user’s eye rest.

The Zeta spacing scale complements the 4px mini unit scale by using multiples of 4. It includes both small increments needed to create appropriate spatial relationships for detail-level designs as well as larger increments used to control the density of a design. Each level of the spacing scale has its own token. Spacing tokens can be used inside of components for building and between components for layout spacing.

Applying space

Spacing can be applied to margin or padding properties, as well as to both vertical and horizontal edges following a more traditional CSS box model.

example:

Content
Border
Padding 3,1,3,4 REM
Margin 3REM (Transparent)
Padding/Margin
Token
px
REM
margin
$spacing.zeta.square.x12
48
3
padding
$spacing.zeta.squish.x12
48
3
padding right
$spacing.zeta.x4
$spacing.zeta.b
16
1
padding left
$spacing.zeta.x16
$spacing.zeta.xl
64
4

Space spatial concepts

Spatial concept we use: insetting content from an edge, varying an inset’s shape, spacing items inline, and stacking items within and between a component.

These concepts — inset, inset squish, stack, inline, and grid — cover the vast majority of our library’s CSS rules for space: padding, margin, left, right, top, and bottom. These concepts also enhance how each atomic is self-contained, improving composability.

Please refer at the bottom of this page (Spacing scale) for token naming explanation.

Image

TYPE
2

Article title more text in
this area to test

3

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

4
1
8
  • Square
    Inset Square spacing

    An inset offers indents content on all four sides. It’s use is widespread, across many components at varying sizes. Example: $spacing.zeta.square.m

  • Squish
    Content

    A squished inset reduces space top and bottom, in our case by 50%. While less common than its squared counterpart, a squish occurred frequently in elements (like a button) and cell-like containers like a data table or list item. Example: $spacing.zeta.squish.m

  • Stack
    Content
    Content

    With all due respect to horizontally scrolled UI, the overwhelming majority scroll vertically. And that means one thing: we stack things. We stack message on heading on data table. We stack modules in rails. We stack copy, pills & toolbars, all in a card, each in a grid. Heck, infinite scroll means infinite stack! We stack, stack, stack. Example: $spacing.zeta.stack.m

  • Inline
    Content
    Content

    We also arrange objects inline, wrapping as they flow like text from the left or right. Such objects — pills, tags, breadcrumbs, and more — may stand alone or stack and mingle with other objects. Example: $spacing.zeta.inline.m

  • Grid
    Content
    Content
    Content
    Content
    Content
    Content
    Content
    Content
    Content

    Use grid spacing for symmetrical gutter widths and heights. Example: see grid.

Element
Padding
Margin
1. card--copy
$spacing.zeta.square.b
0
2. card---type
0
$spacing.zeta.stack.xs
3. card--title
0
$spacing.zeta.stack.s
4. card--description
0
$spacing.zeta.stack.s
5. pill
$spacing.zeta.square.s
0
5. card--pill
0
0, $spacing.zeta.inline.xs, $spacing.zeta.stack.xs, 0
6. card--pills
0
$spacing.zeta.stack.s
7. button
$spacing.zeta.squish.s
0
8. card
0
$spacing.zeta.stack.m

Spacing scale

See also Token naming spreadsheet doc

Use the spacing 4px scale when building individual components. It includes small increments needed to create appropriate spatial relationships for detail-level designs. This scale should applied and be used within all Zeta components.

We have also introduced tokens that use a more human language like T-shirt sizes and spatial naming concepts, as yoy may already noticed from the examples above.

The spacing scale can be applied to margin or padding properties, as well as to both vertical and horizontal edges following a more traditional CSS box model.

Scale
Tshirt
Spatial
Mix
px
rem
$spacing.zeta
$spacing-zeta.square
$spacing.zeta.squish
$spacing.zeta.inline
$spacing.zeta.inline.start
$spacing.zeta.inline.end
$spacing.zeta.stack
0
0
$spacing.zeta.x1
$spacing.zeta.xxs
$spacing-zeta.square.x1
$spacing.zeta.squish.x1
$spacing.zeta.inline.x1
$spacing.zeta.inline.start.x1
$spacing.zeta.inline.end.x1
$spacing.zeta.stack.x1
$spacing-zeta.square.xxs
$spacing.zeta.squish.xxs
$spacing.zeta.inline.xxs
$spacing.zeta.inline.start.xxs
$spacing.zeta.inline.end.xxs
$spacing.zeta.stack.xxs
4
0.25
$spacing.zeta.x2
$spacing.zeta.xs
$spacing.zeta.square.x2
$spacing.zeta.squish.x2
$spacing.zeta.inline.x2
$spacing.zeta.inline.start.x2
$spacing.zeta.inline.end.x2
$spacing.zeta.stack.x2
$spacing.zeta.square.xs
$spacing.zeta.squish.xs
$spacing.zeta.inline.xs
$spacing.zeta.inline.start.xs
$spacing.zeta.inline.end.xs
$spacing.zeta.stack.xs
8
0.5
$spacing.zeta.x3
$spacing.zeta.s
$spacing.zeta.square.x3
$spacing.zeta.squish.x3
$spacing.zeta.inline.x3
$spacing.zeta.inline.start.x3
$spacing.zeta.inline.end.x3
$spacing.zeta.stack.x3
$spacing.zeta.square.s
$spacing.zeta.squish.s
$spacing.zeta.inline.s
$spacing.zeta.inline.start.s
$spacing.zeta.inline.end.s
$spacing.zeta.stack.s
12
0.75
$spacing.zeta.x4
$spacing.zeta.b
$spacing.zeta.square.x4
$spacing.zeta.squish.x4
$spacing.zeta.inline.x4
$spacing.zeta.inline.start.x4
$spacing.zeta.inline.end.x4
$spacing.zeta.stack.x4
$spacing.zeta.square.b
$spacing.zeta.squish.b
$spacing.zeta.inline.b
$spacing.zeta.inline.start.b
$spacing.zeta.inline.end.b
$spacing.zeta.stack.b
16
1
$spacing.zeta.x5
$spacing.zeta.square.x5
$spacing.zeta.squish.x5
$spacing.zeta.inline.x5
$spacing.zeta.inline.start.x5
$spacing.zeta.inline.end.x5
$spacing.zeta.stack.x5
20
1.25
$spacing.zeta.x6
$spacing.zeta.m
$spacing.zeta.square.x6
$spacing.zeta.squish.x6
$spacing.zeta.inline.x6
$spacing.zeta.inline.start.x6
$spacing.zeta.inline.end.x6
$spacing.zeta.stack.x6
$spacing.zeta.square.m
$spacing.zeta.squish.m
$spacing.zeta.inline.m
$spacing.zeta.inline.start.m
$spacing.zeta.inline.end.m
$spacing.zeta.stack.m
24
1.5
$spacing.zeta.x7
$spacing.zeta.square.x7
$spacing.zeta.squish.x7
$spacing.zeta.inline.x7
$spacing.zeta.inline.start.x7
$spacing.zeta.inline.end.x7
$spacing.zeta.stack.x7
28
1.75
$spacing.zeta.x8
$spacing.zeta.l
$spacing.zeta.square.x8
$spacing.zeta.squish.x8
$spacing.zeta.inline.x8
$spacing.zeta.inline.start.x8
$spacing.zeta.inline.end.x8
$spacing.zeta.stack.x8
$spacing.zeta.square.l
$spacing.zeta.squish.l
$spacing.zeta.stack.l
$spacing.zeta.inline.l
$spacing.zeta.inline.start.l
$spacing.zeta.inline.end.l
32
2
$spacing.zeta.x9
$spacing.zeta.square.x9
$spacing.zeta.squish.x9
$spacing.zeta.inline.x9
$spacing.zeta.inline.start.x9
$spacing.zeta.inline.end.x9
$spacing.zeta.stack.x9
36
2.25
$spacing.zeta.x10
$spacing.zeta.square.x10
$spacing.zeta.squish.x10
$spacing.zeta.inline.x10
$spacing.zeta.inline.start.x10
$spacing.zeta.inline.end.x10
$spacing.zeta.stack.x10
40
2.5
$spacing.zeta.x11
$spacing.zeta.square.x11
$spacing.zeta.squish.x11
$spacing.zeta.inline.x11
$spacing.zeta.inline.start.x11
$spacing.zeta.inline.end.x11
$spacing.zeta.stack.x11
44
2.75
$spacing.zeta.x12
$spacing.zeta.square.x12
$spacing.zeta.squish.x12
$spacing.zeta.inline.x12
$spacing.zeta.inline.start.x12
$spacing.zeta.inline.end.x12
$spacing.zeta.stack.x12
48
3
$spacing.zeta.x16
$spacing.zeta.xl
$spacing.zeta.square.x16
$spacing.zeta.squish.x16
$spacing.zeta.inline.x16
$spacing.zeta.inline.start.x16
$spacing.zeta.inline.end.x16
$spacing.zeta.stack.x16
$spacing.zeta.square.xl
$spacing.zeta.squish.xl
$spacing.zeta.inline.xl
$spacing.zeta.inline.start.xl
$spacing.zeta.inline.end.xl
$spacing.zeta.stack.xl
64
4
$spacing.zeta.x20
$spacing.zeta.xxl
$spacing.zeta.square.x20
$spacing.zeta.squish.x20
$spacing.zeta.inline.x20
$spacing.zeta.inline.start.x20
$spacing.zeta.inline.end.x20
$spacing.zeta.stack.x20
$spacing.zeta.square.xxl
$spacing.zeta.squish.xxl
$spacing.zeta.inline.xxl
$spacing.zeta.inline.start.xxl
$spacing.zeta.inline.end.xxl
$spacing.zeta.stack.xxl
80
5
$spacing.zeta.x24
$spacing.zeta.xxxl
$spacing.zeta.square.x24
$spacing.zeta.squish.x24
$spacing.zeta.inline.x24
$spacing.zeta.inline.start.x24
$spacing.zeta.inline.end.x24
$spacing.zeta.stack.x24
$spacing.zeta.square.xxxl
$spacing.zeta.squish.xxxl
$spacing.zeta.inline.xxxl
$spacing.zeta.inline.start.xxxl
$spacing.zeta.inline.end.xxxl
$spacing.zeta.stack.xxxl
96
6
$spacing.zeta.center
auto
auto