Skip to content

A PostCSS plugin to maintain a consistent space throughout your project

License

Notifications You must be signed in to change notification settings

italodr/postcss-space

Repository files navigation

PostCSS Space

Build Status GitHub version

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.

About

A PostCSS plugin to maintain a consistent space throughout your project

Resources

License

Stars

Watchers

Forks

Packages

No packages published