Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Transform access to Rule/Root #109

Merged
merged 3 commits into from
Jun 17, 2022
Merged

Transform access to Rule/Root #109

merged 3 commits into from
Jun 17, 2022

Conversation

luttje
Copy link
Contributor

@luttje luttje commented Jun 15, 2022

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.

Copy link
Owner

@RadValentin RadValentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left one comment. Let's not introduce any breaking changes in this PR, instead I'll make a note to look at dropping root.source.input.file as part of PostCSS 8 upgrade #95 . Feel free to update the readme to mention the new rule argument.

@luttje
Copy link
Contributor Author

luttje commented Jun 16, 2022

@RadValentin Separated tests and added a bit to README. Let me know if I can do anything else here.

@luttje luttje requested a review from RadValentin June 16, 2022 16:59
Copy link
Owner

@RadValentin RadValentin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@RadValentin RadValentin merged commit 2f0ac0b into RadValentin:master Jun 17, 2022
@RadValentin
Copy link
Owner

Published v1.16.0 which includes the changes in this PR, thanks for contributing!

@luttje
Copy link
Contributor Author

luttje commented Jun 17, 2022

My pleasure! 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants