PostCSS plugin to swap :root for :host
npm install postcss-root-to-host[PostCSS] plugin to swap :root for :host.
[postcss]: https://github.com/postcss/postcss
``css`
.root {
--something: great;
}
`css`
:host {
--something: great;
}
Step 1: Install plugin:
`sh`
npm install --save-dev postcss postcss-root-to-host
Step 2: Check you project for existed PostCSS config: postcss.config.js"postcss"
in the project root, section in package.jsonpostcss
or in bundle config.
If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.
Step 3: Add the plugin to plugins list:
`diff``
module.exports = {
plugins: [
+ require('postcss-root-to-host'),
require('autoprefixer')
]
}
[official docs]: https://github.com/postcss/postcss#usage