Created
May 14, 2014 16:01
-
-
Save markhowellsmead/1a9c7316c2602ceb0dc1 to your computer and use it in GitHub Desktop.
Use SVG background images with automatic PNG fallback (LESS mixin)
This file contains hidden or 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
.svg-background-image(@svg,@fallback){ | |
/* | |
From css-tricks.com/using-svg/ | |
coincidentally, if multiple backgrounds are supported, then so are SVG images! | |
Usage: | |
.svg-background-image('my.svg','fallback.png'); | |
*/ | |
background-image: url('@{fallback}'); | |
background-image: url('@{svg}'), none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment