Last active
December 14, 2015 01:19
-
-
Save cheh/5005017 to your computer and use it in GitHub Desktop.
CSS: Gray Filter for All
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.thumb { | |
-webkit-filter: grayscale(100%); // Chrome | |
filter: url("data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'><filter%20id='grayscale'><feColorMatrix%20type='matrix'%20values='0.3333%200.3333%200.3333%200%200%200.3333%200.3333%200.3333%200%200%200.3333%200.3333%200.3333%200%200%200%200%200%201%200'/></filter></svg>#grayscale"); // Firefox | |
&:hover { | |
-webkit-filter: grayscale(0%); | |
filter: none; | |
img { | |
filter: none; | |
} | |
} | |
img { | |
filter: gray; // IE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment