Skip to content

Instantly share code, notes, and snippets.

@benschwarz
Last active May 19, 2017 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benschwarz/5028819 to your computer and use it in GitHub Desktop.
Save benschwarz/5028819 to your computer and use it in GitHub Desktop.
SVG background image with PNG fallback (Sass mixin)
$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');
}
Copy link

ghost commented May 19, 2017

hi @benschwarz the public path "./" redirects to "../css/" root

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment