Skip to content

Instantly share code, notes, and snippets.

@ekka21
Created June 28, 2013 17:01
Show Gist options
  • Save ekka21/5886238 to your computer and use it in GitHub Desktop.
Save ekka21/5886238 to your computer and use it in GitHub Desktop.
sass: mixin
@mixin debug
border: 1px solid red
@mixin hide-txt
overflow: hidden
text-indent: 1500%
white-space: nowrap
@mixin clearfix
&:before,
&:after
content: " "
display: table
&:after
display: block
clear: both
height: 1px
margin-top: -1px
visibility: hidden
@mixin hover-effect
opacity: 1
&:hover
opacity: 0.7
//This is a sample how to use it
//$mapped-images: sprite-map("mapped-images/*.png", $layout: vertical, $spacing: 2)
//.pdf
// +get-sprite($mapped-images, 'pdf')
@mixin get-sprite($map, $sprite, $repeat: no-repeat, $height: true, $width: true)
display: inline-block
+hide-txt
$sprite-image: sprite-file($map, $sprite)
$sprite-map: sprite-url($map)
$sprite-position: sprite-position($map, $sprite)
background: $sprite-map $sprite-position $repeat
@if $height == true
$sprite-height: image-height($sprite-image)
height: $sprite-height
@if $width == true
$sprite-width: image-width($sprite-image)
width: $sprite-width
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment