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

Applying darken function gives different result in libsass 3.5.0 and sass 3.4.21 #2604

Closed
40in opened this issue Mar 19, 2018 · 1 comment
Closed

Comments

@40in
Copy link

40in commented Mar 19, 2018

Here is the full Gist of the range colors #FFFFFF - #EEEEEE: libsas and sass versions

The same example without darken function gives all white, thus expected result here is the same output color. In fact, we have 2 different values going back and forth.

input.scss

test {
  border-top-color: darken(lighten(desaturate(#ffffff, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#fefefe, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#fdfdfd, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#fcfcfc, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#fbfbfb, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#fafafa, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f9f9f9, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f8f8f8, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f7f7f7, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f6f6f6, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f5f5f5, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f4f4f4, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f3f3f3, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f2f2f2, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f1f1f1, 15.7%), 33.5%), 14.625%);
  border-top-color: darken(lighten(desaturate(#f0f0f0, 15.7%), 33.5%), 14.625%);
}

Actual results

libsass v3.5.2

test {
  border-top-color: #dadada;
  border-top-color: #dadada;
  border-top-color: #dadada;
  border-top-color: #b4ffff;
  border-top-color: #dadada;
  border-top-color: #b4ffff;
  border-top-color: #dadada;
  border-top-color: #b4ffff;
  border-top-color: #dadada;
  border-top-color: #b4ffff;
  border-top-color: #b4ffff;
  border-top-color: #dadada;
  border-top-color: #dadada;
  border-top-color: #b4ffff;
  border-top-color: #b4ffff;
  border-top-color: #dadada;
}

Expected result

sass v3.4.21

test {
  border-top-color: #dadada;
  border-top-color: #dadada;
  border-top-color: #dadada;
  ...
  border-top-color: #dadada; 
}
@mgreter
Copy link
Contributor

mgreter commented Mar 19, 2018

Thanks, here a better test case showing the underlying issue:

test {
  $col: desaturate(#fcfcfc, 15.7%);
  test-col: desaturate(#fcfcfc, 15.7%);
  test-hue: hue(lighten($col, 33.5%));
  test-sat: saturation(lighten($col, 33.5%));
  test-lig: lightness(lighten($col, 33.5%));
  test-hsl: darken(hsl(0deg, 0%, 100%), 14.625%);
  combined: darken(lighten($col, 33.5%), 14.625%);
}

Ruby Sass:

test {
  test-col: #fcfcfc;
  test-hue: 0deg;
  test-sat: 0%;
  test-lig: 100%;
  test-hsl: #dadada;
  combined: #dadada; }

LibSass:

test {
  test-col: #fcfcfc;
  test-hue: 180deg;
  test-sat: 100%;
  test-lig: 100%;
  test-hsl: #dadada;
  combined: #b4ffff; }

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

2 participants