Skip to content

Instantly share code, notes, and snippets.

@epicmonkeez
Created March 13, 2012 19:20
Show Gist options
  • Save epicmonkeez/2030896 to your computer and use it in GitHub Desktop.
Save epicmonkeez/2030896 to your computer and use it in GitHub Desktop.
/**
* LESS mixin for Nash Image Replacement (http://nicolasgallagher.com/css-image-replacement-with-pseudo-elements/)
*/
.nir(@image, @width: 100%, @height: 100%) {
display: inline-block; overflow: hidden; width: @width; height: @height;
&:before {
content: url(@image);
display: inline-block; line-height: 0; font-size: 0;
}
}
<!-- content to be placed inside <body>…</body> -->
{"view":"separate","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment