ManuelSch / sass-scss-converter

An online Sass-to-SCSS converter (and vice versa)
MIT License
98 stars 18 forks source link

Incorrect "malformed input" when Sass contains namespaced `@use` #56

Open idlist opened 3 weeks ago

idlist commented 3 weeks ago
@use './vars' as vars

.a-class
  color: vars.$green

This is valid Sass and should get converted, but the site gives "malformed input" error.

As @use './vars' as * with unamespaced $green does not cause error, I guess it might be caused by vars. part.

ManuelSch commented 3 weeks ago

Thanks for your report.

I'll take a look at the issue and keep you updated. In the meantime, feel free to open a pull request in case you'd like to add your own quick fix.

idlist commented 3 weeks ago

Have played with it a while and found that the upstream dependency (sast -> gonzales-pe) cannot parse namespaced @use correctly (as the syntax itself is relatively new). Guess unless there's a library that could align with newer Sass syntax (which I believe there isn't stable one after doing a quick search), the issue is hard to solve at the time... 🤔