Created
November 2, 2012 13:13
-
-
Save judofyr/4001309 to your computer and use it in GitHub Desktop.
Sass-mixin for SVG + PNG-fallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.lt-ie9 .error { | |
background-image: url("images/sprites/sprite.png"); } | |
.error { | |
background-image: url("images/sprites/sprite.svg"); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin img($name, $dir) { | |
.lt-ie9 %img_#{$name} { | |
background-image: url("#{$dir}/#{$name}.png") | |
} | |
%img_#{$name} { | |
background-image: url("#{$dir}/#{$name}.svg") | |
} | |
} | |
@include img("sprite", "images/sprites"); | |
@include img("animation", "images/one-off"); | |
.error { | |
@extend %img_sprite; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment