Skip to main content
Brand and assets
BuildMonitor and contribute
/
Brand and assets
  • Foundations
    • The brand
    • Logo
    • Colors
    • Typography
    • Styles
    • Shadows & radii
    • Spacing & grid
    • Gradients
    • Styling & the sx prop
    • Color tokens
    • More
    • Accessibility
  • Assets
  • AI references
  • Foundations
  • Spacing & grid

Spacing & Grids

Learn more about our base number and the different grids we use across our products.

Base number​

At Alan, the answer to the question to "What is the meaning of life" is 4.

It used to be 6px (a decision from Ed in 2017 because “he felt like it”) but we’ve since evolved it in 2022 to 4px to follow industry standards (and to have more intermediate sizes in order to enhance our UI).

What is the base number for?​

In order to keep an aesthetic rhythm to the visual compositions of all our products & websites, we use the same number as the basis for all spacing and sizing in a mock-up.

Practically, it means:

  • When deciding on the padding or margin of an object, the proposition should always be a multiple of our base number.
  • When deciding on the height or width of an object, if the size is absolute, the proposition should always be a multiple of our base number.

Typography​

All our text styles are multiple of our base number (font-size, line-height, as well as paragraph spacing).

Visual elements​

All visual elements are sized to respect that rythm. For instance, all our icon sizes are multiples of our base number so they’ll naturally fit the baseline.

Grids​

  • Most of our grids have either 16, 12 or 4 columns (multiples of our base number).
  • All absolute sizes within our grids are multiples of our base number.

Grid anatomy​

What are columns & gutters?​

Gutter is the space between columns, and columns are vertical structure that are filled with content (eg. text, components, assets).

What is a container?​

A grid is always used inside of a container that will define the size of the space the grid will be spreading on and how it will resize depending on different screen sizes (cf. our fixed grid).

Sometimes the container has a fixed size (ie. it has a maximum width), sometimes it is fluid, meaning it uses all the space made available by its parent (ie. it has a width of 100%).

What are breakpoints?​

Whenever the container has a fixed width, that width adapts depending on the width of the screen. This is defined through breakpoints. It allows the website to respond according to the device width, allowing to show the best possible layout to our users.

Breakpoint nameScreen size
xs< 640px
sm≥ 640px
md≥ 800px
lg≥ 960px
xl≥ 1120px
Need help picking the correct grid?

Use the provided templates & patterns in our Components file.

Layout grid​

This grid is used to define fixed sizes across our products (eg. sidebar, modals). You should almost never need it unless you’re creating a new product or layout for Alan.

Fixed grid​

This is one of our most used grid, we use it in our full-width modal as well as our website.

BreakpointMax-widthColumnsColumn widthGutters
xsauto12auto16px
sm576px1232px16px
md720px1236px24px
lg912px1244px32px
xl1056px1256px32px
  • Our grid is similar to Bootstrap’s: the gutters are build through paddings on the columns. Eg. for the XL size, the gutter is 32px, so each column has a padding of 16px (gutter divided by 2).
  • XS’s container has an 8px margin so that the content sits 16px away from the sides like on mobile.

Fluid grid​

The fluid grid is used on the content section of the admin dashboard.

Max-widthWidthColumnsGuttersMarginsFluid
auto100%1232px24pxtrue

Mobile grid​

The grid is fluid & the margins stay fixed (if the phone is smaller or bigger).

Max-widthWidthColumnsGuttersMarginsFluid
576px100%416px16pxtrue

Resources​

  • Essentials for designing with space on Shopify’s documentation for Polaris
  • Grid System from Bootstrap’s documentation
  • Getting started with grids in digital design by Monica Galvan on Medium
  • Grid on Thinking with Type
Edit this page
Previous
Shadows & radii
Next
Gradients
  • Base number
    • What is the base number for?
    • Typography
    • Visual elements
    • Grids
  • Grid anatomy
    • What are columns & gutters?
    • What is a container?
    • What are breakpoints?
  • Layout grid
  • Fixed grid
  • Fluid grid
  • Mobile grid
  • Resources