vim-css-color icon indicating copy to clipboard operation
vim-css-color copied to clipboard

Support Sass color functions

Open joseluis opened this issue 9 years ago • 1 comments

Sass allows to use hex color numbers inside rgba(), but that's not getting hightlighted.

color: rgba(#abc, 0.4);

Also there are several more [Sass color functions](rgba($color, $alpha)) that would be nice to support:

Curiously, this one works right now:

color: mix(#abc, red, 20%);

The rest doesn't, like for example:

color: tint(#abc, 0.4);
lighten(#abc, 50%);
grayscale(#abc);

I'm sure some of the functions will be difficult to support, but for others it may be very possible.

Thanks!

joseluis avatar Nov 14 '16 15:11 joseluis

It’ll be trying to parse rgba() with CSS-style syntax which expects 3 numbers instead of a single hex RGB value, and mix() just gets ignored while the hex RGB value is picked up, so both of these make sense. On that basis I would expect tint() to also work, though. As for lighten() and grayscale(), if they’re written like that (without a color: property in front) I’m probably not surprised that they don’t work.

But that’s all just guesswork.

I’ll take a look.

Would you mind filling in the tests/example.sass file with examples of everything that ought to work but currently doesn’t?

ap avatar Nov 16 '16 17:11 ap