Skip to content
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

rgb() and rgba() color values specified in percentages misinterpreted #1332

Closed
terje opened this issue Jul 10, 2015 · 2 comments
Closed

rgb() and rgba() color values specified in percentages misinterpreted #1332

terje opened this issue Jul 10, 2015 · 2 comments

Comments

@terje
Copy link

terje commented Jul 10, 2015

There seems to be an issue with how percentages are interpreted when input to rgb() and rgba() functions. I have the following SASS:

.box1 {
  color: rgb(20%, 20%, 20%);
}
.box2 {
  color: rgb(32, 32, 32);
}
.box3 {
  color: rgba(20%, 20%, 20%, 0.7);
}

Compiling with ruby sass gives me the expected output:

.box1 {
  color: #333333; }

.box2 {
  color: #202020; }

.box3 {
  color: rgba(51, 51, 51, 0.7); }

Whereas sassc seems to return wrong values for the percentage definitions:

.box1 {
  color: white; }

.box2 {
  color: #202020; }

.box3 {
  color: rgba(255, 255, 255, 0.7); }

Note that .box2 with integer values is interpreted correctly.

@xzyfer
Copy link
Contributor

xzyfer commented Jul 13, 2015

Thanks @terje we've confirmed this is still an issue.

xzyfer added a commit to xzyfer/sass-spec that referenced this issue Jul 13, 2015
@xzyfer
Copy link
Contributor

xzyfer commented Jul 13, 2015

Spec added sass/sass-spec#445

@mgreter mgreter self-assigned this Jul 14, 2015
@mgreter mgreter added this to the 3.3 milestone Jul 14, 2015
mgreter added a commit to mgreter/libsass that referenced this issue Jul 14, 2015
mgreter added a commit to mgreter/libsass that referenced this issue Jul 14, 2015
mgreter added a commit to mgreter/libsass that referenced this issue Jul 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants