ritwickdey / vscode-live-sass-compiler

Compile Sass or Scss file to CSS at realtime with live browser reload feature.

Home Page:https://ritwickdey.github.io/vscode-live-sass-compiler/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hex color problem

satowine1 opened this issue · comments

If i using this class:

.test{
  color: #00000020; 
}

with a color written in hex (recognized by VSCode), compiler send me this error:

Compilation Error
Error: Invalid CSS after "  color:": expected expression (e.g. 1px, bold), was "#00000020;"
        on line 784 of sass/c:\Devel\tomcat\webapps\synergy-config\hmi-pers\bootstrap\scss\_custom.scss
>>   color: #00000020; 

If i try to compile same file with another compiler like Koala, the hex color is processed without error.
I think there ia a pbolem with node-sass that not parsing well hex color too long.
It's possible to fix it?

commented

@satowine1 Just use HSLA or RGBA. HEX with alpha channel is so wrong :)

@madebym I know :) I already use rgba notation, but because i can write color with HEX notation, and i can compile them with another sass compiler, this is a problem that should be fixed imho :)

Sorry for the late. This is a library issue. I've nothing to do. I'm now upgrading the extension. Will fix it after next update.

This issue has been fixed from v3.0.0. Please let know if it's still not working.
Thanks for the report.

This problem is not totally fixed when using custom css property.
For exemple:
:root{
--background-color: rgba(#000, 0.25);
}
doesn't compile to :
:root{--background-color: rgba(0,0,0,0.25);}
it stays in its original form