Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Compilation warning using parentheses in alpha + opacity filter #931

Closed
jaydiablo opened this issue Mar 10, 2015 · 0 comments · Fixed by #1194
Closed

Compilation warning using parentheses in alpha + opacity filter #931

jaydiablo opened this issue Mar 10, 2015 · 0 comments · Fixed by #1194

Comments

@jaydiablo
Copy link

Ran into an issue where our designer defined a mixin that caused libsass 3.1.0 to throw a warning and halt compilation. Here's the mixin:

@mixin img-opacity($trans) {
          filter : alpha(opacity=($trans * 100));
      -ms-filter : "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$trans * 100})";
    -moz-opacity : $trans;
  -khtml-opacity : $trans;
         opacity : $trans;
}

libsass specifically complained about the "filter" definition with this message:

error reading values after opacity

Sass 3.2.19 and up process the mixin just fine:

http://sassmeister.com/gist/e68c7a09b749dd1360ac
(you can change to libsass in that UI and see it fail compilation)

With a slight modification to the mixin, libsass handles it just fine:

@mixin img-opacity($trans) {
          filter : alpha(opacity=$trans * 100);
      -ms-filter : "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$trans * 100})";
    -moz-opacity : $trans;
  -khtml-opacity : $trans;
         opacity : $trans;
}

http://sassmeister.com/gist/f4261c967d48b9cd9a18

Seems like libsass doesn't like the parentheses there.

# for free to join this conversation on GitHub. Already have an account? # to comment