Skip to content

Instantly share code, notes, and snippets.

@burnto
Created February 25, 2011 06:59
Show Gist options
  • Save burnto/843455 to your computer and use it in GitHub Desktop.
Save burnto/843455 to your computer and use it in GitHub Desktop.
Image replacement scss mixin
// Image replacement scss mixin
@mixin image_replace($img, $width, $height, $x: 0, $y: 0) {
display: block;
background: image-url($img) no-repeat $x $y;
width: $width;
height: $height;
overflow: hidden;
text-indent: -9999em;
}
// --- Usage ---
header {
#logo {
@include image_replace("logo.png", 200px, 64px);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment