Guidelines

Spacing

Spacing are used to consistently apply margin and padding across elements, components and layouts. With a set scale for spacing, information can be structured to have a consistent and intuitive user interface across the website.

Use of space

A vertical rhythm starts from a baseline and it's the basis for everything from the font sizes, line height and image sizes. The spacing are always referring to fixed values and thus they are not responsive. All spacing can be used as values for both margins and paddings.

Space is used to create hierarchy and visual relationships. By using the spacing, you can achieve visual grouping and other associations both between and within the components. Along with the typography system, they contribute to an overall visual hierarchy, providing users with a structured way of organising information.

Spacing values

NameSize
13xl0px - 4.5rem
12xl0px - 4.25rem
11xl0px - 4rem
10xl0px - 3.75rem
9xl0px - 3.5rem
8xl0px - 3.25rem
7xl0px - 3rem
6xl0px - 2.75rem
5xl0px - 2.5rem
4xl0px - 2.25rem
3xl0px - 2rem
2xl0px - 1.75rem
xl0px - 1.5rem
l0px - 1.25rem
m0px - 1rem
s0px - 0.75rem
xs0px - 0.5rem
2xs0px - 0.375rem
3xs0px - 0.25rem
4xs0px - 0.125rem
5xs0px - 0.0625rem

Do's

  • always use the spacing values when spacing out element (either margin or padding)

Don'ts

  • don't go outside the provided spacing values
  • don't stack the spacing (such as 0px + 0px)

When to use

  • whenever you need to space out the inner parts within a component (when creating a new component that is outside what ECL provided)
  • whenever you need to space out one component from another or other elements outside of a component

When not to use

  • do not use when you want to have responsive spacing since the values are fixed