Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnwatkins0/postcss-spacing-utils
Generates spacing utility classes from user settings.
https://github.com/johnwatkins0/postcss-spacing-utils
css postcss
Last synced: about 1 month ago
JSON representation
Generates spacing utility classes from user settings.
- Host: GitHub
- URL: https://github.com/johnwatkins0/postcss-spacing-utils
- Owner: johnwatkins0
- License: mit
- Created: 2018-01-02T13:52:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-23T16:45:13.000Z (over 6 years ago)
- Last Synced: 2024-09-29T23:22:56.412Z (about 2 months ago)
- Topics: css, postcss
- Language: CSS
- Size: 61.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-spacing-utils
Generates spacing utility classes from user settings.
## Install
```
npm install --save-dev postcss-spacing-utils
```OR
```
yarn add --dev postcss-spacing-utils
```## Usage
The plugin requires a single configuration variable, `spacers`, an array of CSS sizes from which to generate spacing utils.
Add your settings to your postcss configuration, e.g.:
```Javascript
module.exports = {
plugins: {
'postcss-spacing-utils': {
// Your options, or empty to use the defaults.
},
},
};
```### Defaults
Leave your settings empty to use the following defaults.
```Javascript
{
spacers: [
'0',
'.375rem',
'.75rem',
'1.5rem',
'2.25rem',
'3rem',
'4.5rem',
'6rem',
],
}
```### Generated CSS classes
The generated classes are identical to those generated by Bootstrap 4. See [Bootstrap's documentation](https://getbootstrap.com/docs/4.0/utilities/spacing/) for details.