Created
June 28, 2013 17:01
-
-
Save ekka21/5886238 to your computer and use it in GitHub Desktop.
sass: mixin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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) | |
// +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