Spacing

Introduction

In the search of consistent alignment between the elements we provide a spacing scale based on a root values of 8px and 4px. The numbers 4 and 8 are easily multiplied, they provide flexible and consistent, yet distinct enough, steps between them.

Spacing overview

The spacing scale can be applied to margin or padding properties, as well as to both vertical and horizontal edges. The token takes the place of the values normally assigned to this properties.

Spacing methods

Fixed spacing

Althouhg the fixed spacing scale is most commonly used for vertical spacing, it can also be applied for horizontal spacing, especially in the case of spacing inside components.

Spacing methods

Left: Horizontal: Used for smaller, more refined spacing needs, inside components.

Right: Vertical: Used for positioning components on a page.

Fluid spacing

The use of percentages (e.g. 50% or 33%) is a recommended way to divide a page or to control a component max-width and min-width. Using percentages for top and bottom values of padding or margin inside of a component or element should be avoided.

Core spacing tokens

The core spacing scale is used to create space relationships for detail-level designs.

Tokenrempx
spacing-000
spacing-20.1252
spacing-40.254
spacing-80.58
spacing-120.7512
spacing-16116
spacing-241.524
spacing-32232
spacing-402.540
spacing-48348
spacing-563.556
spacing-64464
spacing-80580
spacing-96696
spacing-1127112

Component spacing tokens

Most components across Halstack can adopt our component spacing tokens as margin or padding in every direction in order to create white space between components.

Padding properties

Usage of the medium token for left, right, bottom and top padding properties.

Component tokenCore tokenValue
xxsmallspacing-44px
xsmallspacing-88px
smallspacing-1212px
mediumspacing-1616px
largespacing-2424px
xlargespacing-3232px
xxlargespacing-4848px