-
Notifications
You must be signed in to change notification settings - Fork 40
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
Comments in --var not removed #75
Comments
Yes, this isn't super intuitive behavior, but Being a superset of CSS, Sass must allow (almost) any value -- including what look like Sass comments -- to be part of custom properties. Although this is potentially surprising behavior, there are some users that rely on accessing such variables from JavaScript, and so Sass must parse custom properties specially. It seems that You should be able to work around this by using loud comments, |
Thanks for the detailed explanation, yeah, found it out and am using the By the way, what do you think about having a flag/option to enable the more convenient parsing? |
I've thought about a flag like "libsass quirks mode" that makes parsing more similar to libsass, but I wouldn't want to deal with the added maintenance burden of this. I would be hesitant to add a general flag for grass-specific parsing changes for similar reasons, in addition to compatibility concerns with other Sass implementations. |
Found a trick to use proper comments in the output, :root.light
#{--var}: oklch(.87 0 90) // comment are removed in the output!!! |
upd: I see that it's a common sass misfeature sass/sass#2770
so unlikely to expect grass to deviate
I'm using grass via zola SSG and I've noticed that comments in
--var
are not stripped from the output, thus breaking my ability to add comments with explanations for colorsI see that
CSS variables should include everything, notably comments https://github.com/connorskees/grass/pull/67
on #19, which is maybe related and implies this is intentional, but I don't understand the reason behind that, the comments like these aren't meant to be includedAlthough that example has
foo: //;
a semicolon, while the one I'm using is the cleaner sass version, so maybe this explains it?(although some online dart sass tools strip the comments properly fro this format)
The text was updated successfully, but these errors were encountered: