Skip to content

Instantly share code, notes, and snippets.

@shgtkshruch
Last active December 30, 2015 05:19
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 shgtkshruch/7782176 to your computer and use it in GitHub Desktop.
Save shgtkshruch/7782176 to your computer and use it in GitHub Desktop.
@mixin text-bg-extend($image, $hover: "false")
display: block
width: image-width($image)
text-indent: -9999px
@if $hover == "false"
height: image-height($image)
@else if $hover == "true"
height: image-height($image) / 2
&:hover
background-position: 0 image-height($image) / 2 * -1
@mixin text-bg($image, $hover: "false")
background: image-url($image)
+text-bg-extend($image, $hover)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment