postcss-space

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i postcss-space

Weekly Downloads

61

Version

1.0.0

License

MIT

Unpacked Size

3.51 kB

Total Files

5

Last publish

Collaborators

  • italodr