Closed maranomynet closed 2 years ago
I'm looking towards https://www.sassmeister.com/ for the expected behavior in each of these test cases
Note to self: In https://github.com/postcss/postcss-nested/pull/147/commits/52a602cddf94786aaea730f63d14037ec699afa4 I add some basic type definitions (via JSDoc). This immediately surfaces some obvious problems.
Ping me, when implementation will be ready. It looks very interesting.
Making small progress... 2/7 failing tests now passing.
Hi @ai I'm done now.
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 at-root
handling out of the Rule
method and into two separate tree-walk passes — first on Once
where I normalize and prepare the at-root nodes, and then on RootExit
where I unwrap and drill upp the tree and split up blocks as needed.
What's left in the Rule
method is just the conditional selector merging faff.
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. Also, in this case adding type hints at the start immediately surfaced errors that were hiding in plain sight.
Unofficial nested has no future. We will not have too many PRs in the future.
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.