Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created February 28, 2013 13:28
Show Gist options
  • Save jensgro/5056686 to your computer and use it in GitHub Desktop.
Save jensgro/5056686 to your computer and use it in GitHub Desktop.
Simple mixin to integrate a box-shadow and include a filter-expression for oldIE. If the box-shadow is inset the filter will be omitted as it doesn't provide inset-view.
@mixin box-s($x, $y, $offset, $color, $inset: false) {
$ie-color: ie-hex-str($color);
@if $inset {
-webkit-box-shadow: inset $x $y $offset $color;
box-shadow: inset $x $y $offset $color;
} @else {
-webkit-box-shadow: $x $y $offset $color;
box-shadow: $x $y $offset $color;
filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=#{$x}, OffY=#{$y}, Color='#{$ie-color}');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment