Skip to content

Instantly share code, notes, and snippets.

@markhowellsmead
Created May 14, 2014 16:01
Show Gist options
  • Save markhowellsmead/1a9c7316c2602ceb0dc1 to your computer and use it in GitHub Desktop.
Save markhowellsmead/1a9c7316c2602ceb0dc1 to your computer and use it in GitHub Desktop.
Use SVG background images with automatic PNG fallback (LESS mixin)
.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