Replies: 1 comment 3 replies
-
You can use Root event and then root.walkRules(). But it is better to convert .item to .item.item inside your plugin. Preparing CSS before another plugin is a bad practice (what if your user will forget to add anorther plugin?). |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i'm trying to write a plugin that will run before
postcss-nested
. I want the plugin to find each rule and wrap it like below:Before:
After:
I was able to get this working by modifying
rule.nodes[0].raws.before
andrule.nodes[0].parent.raws.after
, however it doesn't seem to be working withpostcss-nested
as I expect. It inserts the CSS correctly, but it doesn't translate it to:Is it because i'm using
.raws
or could it be because the plugins aren't running in the order I expect?Beta Was this translation helpful? Give feedback.
All reactions