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

Properly handle alpha units #1525

Open
nex3 opened this Issue Nov 15, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@nex3
Contributor

nex3 commented Nov 15, 2014


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

@nex3 nex3 added this to the 4.0 milestone Aug 21, 2015

@nex3 nex3 removed this from the 4.0 milestone Jul 13, 2018

@nex3

This comment has been minimized.

Contributor

nex3 commented Jul 13, 2018

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?

@lawki

This comment has been minimized.

lawki commented Sep 27, 2018

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.

@nex3

This comment has been minimized.

Contributor

nex3 commented Sep 27, 2018

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

@lawki

This comment has been minimized.

lawki commented Sep 28, 2018

Got it, thanks.

nex3 added a commit to sass/sass-spec that referenced this issue Oct 15, 2018

@nex3 nex3 added the Specs Written label Oct 16, 2018

nex3 added a commit to sass/sass-spec that referenced this issue Oct 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment