Skip to content

Instantly share code, notes, and snippets.

@jnowland
Created November 19, 2012 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jnowland/4108777 to your computer and use it in GitHub Desktop.
Save jnowland/4108777 to your computer and use it in GitHub Desktop.
Logo mixin to include fallback SVG
// Currently an idea, yet to test this snippet.
@mixin logo( $logo-name) {
$image: "#{$logo-name}.png";
.logo {
background-repeat:no-repeat;
display:block;
overflow:hidden;
text-indent:-9999em;
width:image-width($image);
height:image-height($image);
.svg & {
background-image:url("img/#{$logo-name}.svg");
}
.no-svg & {
background-image:url("img/#{$logo-name}.png");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment