Skip to content

Instantly share code, notes, and snippets.

@kokarn
Last active December 11, 2015 22:58
Show Gist options
  • Save kokarn/4673391 to your computer and use it in GitHub Desktop.
Save kokarn/4673391 to your computer and use it in GitHub Desktop.
CSS3 Grayscale (kinda)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
.object-in-same-group-as-selected-object {
filter: url( '../resources/filters/filters.svg#grayscale' ); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Google Chrome & Safari 6+ */
-webkit-filter: grayscale(100%); /* New WebKit */
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%); /* Not yet supported in Gecko, Opera or IE */
filter: grayscale(100%); /* Current draft standard */
}
.selected-object,
.object-in-same-group-as-selected-object:hover {
filter: none;
-webkit-filter: grayscale(0);
-moz-filter: grayscale(0);
-ms-filter: grayscale(0);
-o-filter: grayscale(0);
filter: grayscale(0);
}
@jwilsson
Copy link

Works like a charm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment