Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songsterr/postcss-sayonara
PostCSS plugin to limit used declarations to a given set
https://github.com/songsterr/postcss-sayonara
cleanup css limit postcss postcss-plugin
Last synced: 19 days ago
JSON representation
PostCSS plugin to limit used declarations to a given set
- Host: GitHub
- URL: https://github.com/songsterr/postcss-sayonara
- Owner: songsterr
- License: mit
- Created: 2019-12-03T09:30:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-07T10:55:57.000Z (about 1 year ago)
- Last Synced: 2024-10-17T13:34:43.931Z (29 days ago)
- Topics: cleanup, css, limit, postcss, postcss-plugin
- Language: JavaScript
- Size: 1.51 MB
- Stars: 2
- Watchers: 10
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS Sayonara
[PostCSS] plugin to limit used declarations to a given set.
![version](https://img.shields.io/npm/v/postcss-sayonara?style=flat-square)
![node-current](https://img.shields.io/node/v/postcss-sayonara?style=flat-square)
![npm](https://img.shields.io/npm/dt/postcss-sayonara?style=flat-square)
![licence](https://img.shields.io/npm/l/postcss-sayonara?style=flat-square)
![Snyk Vulnerabilities for npm package](https://img.shields.io/snyk/vulnerabilities/npm/postcss-sayonara?style=flat-square)[PostCSS]: https://github.com/postcss/postcss
```css
.foo {
/* Input example */
fill: #fff;
cursor: pointer;
}
``````css
.foo {
/* Output example */
fill: #fff;
}
```## Usage
Check you project for existed PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.If you already use PostCSS, add the plugin to plugins list:
```diff
module.exports = {
plugins: [
+ require('postcss-sayonara')({
+ allowedPropNames: [
+ 'stroke', 'stroke-width', 'stroke-opacity', 'stroke-dasharray',
+ 'stroke-dashoffset', 'stroke-linecap',
+ 'stroke-linejoin', 'stroke-miterlimit',
+ 'fill', 'fill-rule', 'fill-opacity',
+ 'clip-path', 'mask',
+ 'opacity', 'color', 'stop-color', 'stop-opacity',
+ 'font-family', 'font-size', 'font-weight',
+ 'text-anchor', 'visibility', 'display',
+ ],
+ }),
require('autoprefixer'),
],
}
```If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.[official docs]: https://github.com/postcss/postcss#usage