A PostCSS plugin to remove all instances of “:root” from a stylesheet.
This plugin is very basic. It removes all instances of :root
from a processed stylesheet (if present). It comes in handy if you are using postcss-custom-properties to process CSS variables. The included test assumes this scenario.
Otherwise, you probably have no use for this plugin. You should run this plugin after running postcss-custom-properties.
npm install --save postcss-remove-root
:root {
--color-blue: blue;
}
.color-blue {
color: var(--color-blue);
}
.color-blue {
color: blue;
}
See the PostCSS documentation for examples on how to use this plugin in different environments.
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
$ npm test
).
postcss-remove-root is a project by @cbracco and its contributors. It is based on code originally found in Basscss, a project by jxnblk. This README is based on the one found in postcss-import.
Thank you for your hard work!