Primer CSS Spacing Scale
Primer CSS is a free open-source CSS framework based on technologies that provide insights into important style aspects like space, font, and color. This meticulous methodology ensures that its patterns are both stable and compatible. It’s mostly practical and adaptable. It was created using the GitHub design system. Object-oriented CSS foundations, practical CSS, and BEM design guide its CSS approach.
Primer CSS Spacing Scale is a predefined range of values that is used to specify the amount of the utilities like margin, padding, etc. The spacing scale used in Primer CSS is a base-8 scale, using it is extremely flexible because we can multiply or divide the eight as many times as we want and we will end up with whole numbers.
All the variables and values of the basic spacer scale:
We use the scale values for various utilities like Margin, padding, etc.
There are no absolute used classes for this but this is used in various utility classes.
- Amount of margin needed: For example, m-5 means 32px of margins will be added in all the directions.
- Amount of padding needed: For example, p-5 means 32px of padding will be added in all the directions.
They are also used in utilities like Borders etc.
Example 1: The example below shows the usage of the spacing scale for specifying the padding and margin around the container. We have used p-4 which specifies the padding to be 24px all around the HTML div container.
Example 2: The below example shows the usage of the spacing scale for specifying the padding and rounding of borders around the container. We have used p-4 which specifies the padding to be 24px all around the div container. We have also used the rounded-2 class which specifies the rounding of the borders to be 8px.
Please Login to comment...