Jan Tojnar
|
17e76d772c
|
Upgrade to PostCSS 8
The PostCSS 7’ `postcss.plugin` method has been deprecated in favour of manually created function returning an object containing various event handling functions like `Once`, `Declaration`, `Rule` and many more.
```patch
- module.exports = postcss.plugin('postcss-dark-theme-class', (opts = {}) => {
- checkOpts(opts)
- return (root, result) => {
root.walkAtRules(atrule => { … })
- }
- })
```
```patch
+ module.exports = (opts = {}) => {
+ checkOpts(opts)
+ return {
+ postcssPlugin: 'postcss-dark-theme-class',
+ Once (root, { result }) {
root.walkAtRules(atrule => { … })
+ }
+ }
+ }
+ module.exports.postcss = true
```
https://evilmartians.com/chronicles/postcss-8-plugin-migration
|
3 years ago |