In issue #108 we discussed getting access to the raw postcss Root in the transform callback. While I was working on this I realized that you can get Root from a Rule (Rule#root). Giving the user access to the current Rule therefor opens up even more options.
I have added tests that also demonstrate why this feature is useful.
In issue #108 we discussed getting access to the raw postcss Root in the transform callback. While I was working on this I realized that you can get Root from a Rule (Rule#root). Giving the user access to the current Rule therefor opens up even more options.
I have added tests that also demonstrate why this feature is useful.
If you don't mind making a breaking change I would consider removing this line: https://github.com/luttje/postcss-prefix-selector/blob/c61250e46d63f34913702253f076de72a0daa730/index.js#L47 Since that can now be reached through
rule.root.source.input.file
Let me know if I need to add/change something. If you think it's all good, let me know and I'll add a bit of explanation to the README as well.