Skip to content

Instantly share code, notes, and snippets.

@saki007ster
Created September 3, 2013 05:21
Show Gist options
  • Save saki007ster/6419957 to your computer and use it in GitHub Desktop.
Save saki007ster/6419957 to your computer and use it in GitHub Desktop.
@mixin drop-shadow($color:rgba(0,0,0,0.2), $blur:0, $x:0, $y:0) { // color, blur, x, y
-ms-box-shadow:$x $y $blur $color; // IE10+
@if ($x == 0 and $y == 0) { // non directional glow
filter: Glow(color=#{ie-hex-str($color)},strength=#{numericvalue($blur)});
-ms-filter: glow(color=#{ie-hex-str($color)},strength=#{numericvalue($blur)});
} @else {
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=#{numericvalue($blur)}, Direction=#{degrees($x, $y)}, Color='#{ie-hex-str($color)}')"; // IE8
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=#{numericvalue($blur)}, Direction=#{degrees($x, $y)}, Color='#{ie-hex-str($color)}'); // IE7-
}
-o-box-shadow:$x $y $blur $color; // Opera
-moz-box-shadow:$x $y $blur $color; // Firefox
-webkit-box-shadow:$x $y $blur $color; // Webkit (Safari, Chrome, other)
box-shadow:$x $y $blur $color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment