1.0.0 • Published 3 years ago

postcss-space v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

PostCSS Space

Build Status

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.