-
Notifications
You must be signed in to change notification settings - Fork 12
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
Parser doesn't understand the new @use
syntax
#145
Comments
As written in project readme: "Not all Sass syntax supported. Parser under development.". So, for now I'm not planning to add |
@AleshaOleg can you just tell me which sections of code should I be looking at? |
@algomaster99 this is the main parser (better to say converter from one tree to another) file - https://github.com/AleshaOleg/postcss-sass/blob/master/parser.es6. Basically it's just a large loop with a lot of nestings for a tree which comes from gonzales-pe (real SASS parser) - https://github.com/AleshaOleg/postcss-sass/blob/master/parser.es6#L34 What you need to do:
|
@AleshaOleg So I tried to make
But I think this is wrong because these are css Then I tried to extrapolate how
I created my case something like this:
|
You're actually on the correct way to resolve this. This happens because the parser returns an empty string for this case. As I see gonzales-pe return that node for your case:
You can console.log full node after this code and you'll see it. So, as you can see parser returns as a You need to determine the type of children node of the ruleset and handle it after That children node might be |
@algomaster99 Where have you gotten with this? I might consider taking this up depending on what else you might have found out. |
@roydukkey hi! You can go ahead with this issue. I couldn't make time to solve it. |
Hi @roydukkey, from what I see gonzales-pe (parser from where postcss-sass getting Sass AST), not supporting use-cases for @use keywords, like using variables from @use alias, or @include keyword. I don't think it's possible to resolve this issue now. AS you can see from screenshots |
Interesting. Do you know if there is an issue upstream to track for this one? Seems we're getting deep. :) |
@roydukkey I checked issues for gonzales-pe, didn't find anything related. Feel free to create a new one I guess |
The snippet:
throws
Checkout the demo here.
Further Reference:
The text was updated successfully, but these errors were encountered: