New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve @at-root
behavior
#147
Conversation
I'm looking towards https://www.sassmeister.com/ for the expected behavior in each of these test cases |
c6f2c2c
to
52a602c
Compare
Note to self: |
Ping me, when implementation will be ready. It looks very interesting. |
4351e48
to
2beaff0
Compare
Making small progress... 2/7 failing tests now passing. |
dc918cc
to
084f23e
Compare
Hi @ai I'm done now. |
As per examples given in the postcss docs: https://github.com/postcss/postcss/blob/main/docs/writing-a-plugin.md#step-4-change-nodes
5a8dd55
to
cf2bbf0
Compare
Right now, I can't think of any more cases to test, and everything passes. Feel free to add more tests if you can think of any. |
I've basically moved most of the What's left in the |
index.js
Outdated
|
||
RootExit(root) { | ||
if (root[hasRootRule]) { | ||
root.walk(node => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
walkAtRules()
will be readable and could be even a little faster
index.js
Outdated
Rule (rule, { Rule }) { | ||
|
||
Once(root) { | ||
root.walk(node => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use walkAtRules()
here as well
Looks good. I will try to merge it tomorrow. Note that I am planning to remove type comments since I do not use them. |
Type comments lower the barrier of entry for others to make PRs. |
Unofficial nested has no future. We will not have too many PRs in the future. |
Not sure how/why this didn't show up yesterday or the day before. VSCode's ESLint plugin must have silently crashed or something.
Thanks. Released in 6.0. |
This is a work in progress PR.
I haven't looked into
index.js
yet, so I don't really know my chances of fixing any of these myself.Feel free to either clone/take over this patch branch, or push commits to it.