postcss-space
v1.0.0
Published
Maintain a consistent space throughout your project
Downloads
195
Maintainers
Readme
PostCSS Space
Maintain a consistent space throughout your project
Before:
.foo {
height: space(20);
margin: space() space(2);
}
After:
.foo {
height: 160px;
margin: 8px 16px;
}
Usage
No options:
postcss([ require('postcss-space') ])
With options:
postcss([ require('postcss-space') ])
({
base: 4,
unit: 'rem'
})
With CSS variables options:
:root {
--space-base: 0.5;
--space-unit: rem;
}
postcss([ require('postcss-space') ])
Fallback options:
{
base: 8,
unit: 'px'
}
See PostCSS docs for examples for your environment.