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 name | Screen size |
|---|---|
| xs | < 640px |
| sm | ≥ 640px |
| md | ≥ 800px |
| lg | ≥ 960px |
| xl | ≥ 1120px |
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.

| Breakpoint | Max-width | Columns | Column width | Gutters |
|---|---|---|---|---|
| xs | auto | 12 | auto | 16px |
| sm | 576px | 12 | 32px | 16px |
| md | 720px | 12 | 36px | 24px |
| lg | 912px | 12 | 44px | 32px |
| xl | 1056px | 12 | 56px | 32px |
- 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-width | Width | Columns | Gutters | Margins | Fluid |
|---|---|---|---|---|---|
| auto | 100% | 12 | 32px | 24px | true |

Mobile grid
The grid is fluid & the margins stay fixed (if the phone is smaller or bigger).
| Max-width | Width | Columns | Gutters | Margins | Fluid |
|---|---|---|---|---|---|
| 576px | 100% | 4 | 16px | 16px | true |

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