Skip to content

Instantly share code, notes, and snippets.

@killercup
Created September 10, 2013 14:53
Show Gist options
  • Save killercup/6510613 to your computer and use it in GitHub Desktop.
Save killercup/6510613 to your computer and use it in GitHub Desktop.
/*
* SVG Background with Fallback
*
* Usage:
.logo {
margin: 12px auto 0;
$w: 150px;
$h: 75px;
width: $w;
height: $h;
@include svg-bg-with-fallback("book-compact-logo", $w, $h);
}
*/
@mixin svg-bg-with-fallback($src, $width, $height) {
background: image-url("#{$src}.png") no-repeat 0px 0px;
background: linear-gradient(transparent, transparent),
image-url("#{$src}.svg") no-repeat 0px 0px;
background-size: $width $height;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment