Spacing
The spacing scale utilities classes.
Scaling
The spacing scale is a base-8 scale. We chose a base-8 scale because eight is a highly composable number (it can be divided and multiplied many times and result in whole numbers), yet allows spacing dense enough for GitHub’s UI. The scale’s exception is that it begins at 4px to allow smaller padding and margin for denser parts of the site, from there on it steps up consistently in equal values of 8px.
Variable | Scale | Value |
---|---|---|
--spacer-0 | 0 | 0 |
--spacer-1 | 1 | 4px |
--spacer-2 | 2 | 8px |
--spacer-3 | 3 | 16px |
--spacer-4 | 4 | 24px |
--spacer-5 | 5 | 32px |
--spacer-6 | 6 | 40px |
← Colors Typography →