Skip to content

Instantly share code, notes, and snippets.

@crecotun
Created March 20, 2016 06:16
Show Gist options
  • Save crecotun/07e587a2c09c7651fa2e to your computer and use it in GitHub Desktop.
Save crecotun/07e587a2c09c7651fa2e to your computer and use it in GitHub Desktop.
Sprite mixin for sass
@mixin sprite($sprite)
$selector: #{&}
$hover: str-index($selector, 'hover')
$active: str-index($selector, 'active')
@if not ($active or $hover)
+spriteImage($sprite)
+spritePosition($sprite)
+spriteWidth($sprite)
+spriteHeight($sprite)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment