Commit graph

5 commits

Author SHA1 Message Date
Sven Slootweg 008e6d1e73 0.1.1 2022-04-23 12:10:15 +02:00
Sven Slootweg 2ecb34fc8a Merge branch 'jtojnar-postcss-8' 2022-04-23 12:09:58 +02:00
Sven Slootweg 6351c00e6b Make compatible with both old and new plugin versions 2022-04-23 12:09:07 +02:00
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
2022-02-02 23:05:12 +01:00
Sven Slootweg 61b6a18b43 Initial commit 2020-06-14 19:12:53 +02:00