Skip to content

Instantly share code, notes, and snippets.

@bitflower
Forked from SimonWpt/example.sass
Last active August 29, 2015 14:24
Show Gist options
  • Save bitflower/447f98d76ef4f206b645 to your computer and use it in GitHub Desktop.
Save bitflower/447f98d76ef4f206b645 to your computer and use it in GitHub Desktop.
img
// graycity($gray, $opacity)
@include graycity(0.5, 0.7)
@mixin graycity($gray: 0.7, $opacity: 0.8)
opacity: $opacity
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(grayscale=$gray)"
filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="grayscale"><feColorMatrix type="matrix" values="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"/></filter></svg>#grayscale')
filter: gray($gray)
-webkit-filter: grayscale($gray)
&:hover
opacity: 1
filter: none
-ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)"
-webkit-filter: grayscale(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment