Skip to content

Instantly share code, notes, and snippets.

@napotopia
Created September 27, 2013 11:24
Show Gist options
  • Save napotopia/6727184 to your computer and use it in GitHub Desktop.
Save napotopia/6727184 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.2.10)
// Compass (v0.13.alpha.4)
// ----
@mixin insertSVGWithFallback($image, $fallBackClass:'no-svg') {
background: url($image + ".svg") 0 0 no-repeat;
.#{$fallBackClass} & {
background: url($image + ".png") 0 0 no-repeat;
}
}
.foo {
@include insertSVGWithFallback('../images/icon_vvt_beta');
}
.foo {
background: url("../images/icon_vvt_beta.svg") 0 0 no-repeat;
}
.no-svg .foo {
background: url("../images/icon_vvt_beta.png") 0 0 no-repeat;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment