sass / sass

Sass makes CSS fun!

Home Page:https://sass-lang.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Properly handle alpha units

nex3 opened this issue · comments


Currently rgba() and hsla() completely ignore units on the $alpha argument. They should interpret percentages per spec and fail for any other unit.

This is handled correctly by Dart Sass, but it looks like it's still marked as TODO for LibSass.

@xzyfer Is there an issue tracking this on the LibSass side yet?

The spec at http://dev.w3.org/csswg/css-color/#typedef-alpha-value says that percentages(0-100%) and number(0-1) are allowed for alpha argument.
My understanding from issue description is that it should fail when anything other than % are given as argument. So,
.card{ color: rgba(255,255,255,0.5); }
should fail, but
.card{ color: rgba(255,255,255,50%); }
should pass? Kindly clarify.

@lawki These functions are intended to allow unitless numbers between 0 and 1 as well.

Got it, thanks.

Closing this out because LibSass is now deprecated and we aren't expecting to add any additional features to it.