Spacing units

The Clinical Design System follows the USWDS and VADS spacing unit tokens.

The spacing unit tokens are based on multiples of 8px, with additional tokens for small sizes (1x, 2px, 4px, 12px and 20px) and goes up to 560px or 70 units.

Any spacing value in utilities or component CSS should use the following spacing unit tokens, based on multiples of 8px. The documentation below displays a target value in pixels, but the final output for tokens is the equivalent value in rem, where one unit is 1rem divided by 2, which will vary depending on your project settings.


Using the mixin

Import the mixin in your Sass file using the following.

Note - It is recommended to namespace your import using as NAMESPACE to avoid conflicts with other files using the same token.

@use '../../../core/tokens/spacing' as spacing;

Then define desired values using the following

spacing.grid(1)

Sample of returned values

Note - You can use spacing.grid(TOKEN) up to spacing.grid(70)

Token Multiple Value Example
1px - 1px
2px - 2px
0.5 0.5 4px
1 1 8px
1.5 1.5 12px
2 2 16px
2.5 2.5 20px
3 3 24px
4 4 32px
5 5 40px
6 6 48px
7 7 56px
8 8 64px
9 9 72px
10 10 80px
15 15 120px