Closed a-x- closed 7 years ago
Interesting case. I understand that it will be useful. But I afraid of non-standard syntax. What is CSSWG will announce :global
pseudo (not function).
I see two options. Add extra option. Or create postcss-global-nested
plugin. I think new plugin is better, because I little busy with my new open source in next month.
In this plugin you can take care only about :global
. Other nesting will be fixed by postcss-nested (you will use them both).
I think it will be 7 lines plugin:
module.exports = postcss.plugin("postcss-global-nested", () => {
return root => {
root.walkRules(rule => {
rule.selector = rule.selector.replace(/:global\s+([\w\W]+)/, ":global($1)")
}
}
}
I will add your plugin to postcss-nested docs. What do you think about it?
Hey, @ai,
such plugin is the good solution
even it's not spoiling standard-based postcss-nested
plugin as you mentioned here.
R u want to create it yourself in a week or you'll be awaiting a PR?
@a-x- you can create it :)
I want to put styles into a
:global
like this: