Created
February 26, 2013 09:41
-
-
Save orioltf/5037302 to your computer and use it in GitHub Desktop.
#CSS #SCSS #SVG: SVG background with fallback + mixin
Credit: http://germanforblack.com/post/43975575422/protip-all-browsers-that-support-svg-background-images
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
/* Credit: http://germanforblack.com/post/43975575422/protip-all-browsers-that-support-svg-background-images */ | |
.module { | |
background: url('logo.png'); | |
background: none, url('logo.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
/* Credit: http://germanforblack.com/post/43975575422/protip-all-browsers-that-support-svg-background-images */ | |
$public_path: ./; | |
@mixin vector-bg-with-fallback($name) { | |
background-image: url('#{$public_path}images/#{$name}.png'); | |
background-image: none, url('#{$public_path}images/#{$name}.svg'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment