Closed s1n7ax closed 1 month ago
I've released 0.4.0 with the @container
query support PR merged.
@basro Hi, When pixel amount is used, container parsing works but when variable is used, parsing fails.
@container (min-width: #{$screen-md}) {
& {
background-color: green;
padding-left: 10rem;
padding-right: 10rem;
}
}
Would be better to open a separate issue for that. I'll see if I can fix it.
The problem comes from the sass interpolation syntax #{...}
which I must admit didn't know existed.
Seems like sass lets you use variables in @media
queries, but for @container
it wont automatically replace them so interpolation needs to be used...
@basro Might be a complete re-right but treesitter would be a better approach. I have no clue how to communicate with the c parser from rust though.
For now I've released v0.5.0 which will accept sass interpolation syntax in many places. Probably not all places where sass accepts it, but it will at least accept your example without issues.
Using tree sitter might make sense but as you noted, it's a rewrite and is not worth it for me at the moment. Also, the small custom parser in stylance probably has an advantage when it comes to compilation times that have to be weighted in. (Haven't measured though, just guessing)
I'll close this issue. Scoped classes in @extend remains unsupported, if you have interest in that feature feel free to open an issue that is specifically about that.
classes used in
@media
quries are correcly being resolved.However,
@extend
&@container
classes are not resolved and it's using the literal text in the original class name.