Skip to content

Instantly share code, notes, and snippets.

@mturjak
Created October 28, 2013 10:13
Show Gist options
  • Save mturjak/7194396 to your computer and use it in GitHub Desktop.
Save mturjak/7194396 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="grayscale">test2</div>
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@mixin grayscale_element($value) {
-webkit-filter: #{"grayscale(#{$value})"};
-moz-filter: #{"grayscale(#{$value})"};
filter:#{"grayscale(#{$value})"};
}
$value: 70%;
.grayscale {
width: 100px;
height: 100px;
background-color: #e86ea4;
@include grayscale_element(#{$value});
&:hover {
@include grayscale_element(0);
}
}
.grayscale {
width: 100px;
height: 100px;
background-color: #e86ea4;
-webkit-filter: grayscale(70%);
-moz-filter: grayscale(70%);
filter: grayscale(70%);
}
.grayscale:hover {
-webkit-filter: grayscale(0);
-moz-filter: grayscale(0);
filter: grayscale(0);
}
<div class="grayscale">test2</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment