Created
December 9, 2014 03:04
-
-
Save tammyhart/9f996f85469743831743 to your computer and use it in GitHub Desktop.
Image Sprite Mixins
This file contains 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 sprite-bg-size( $divisor: 2 ) { | |
$width: 240px; | |
$height: 360px; | |
$new-width: $width / $divisor; | |
$new-height: $height / $divisor; | |
background-size: round($new-width) round($new-height); | |
} | |
@mixin sprite-bg-position( $left, $top, $divisor: 2 ) { | |
$new-left: $left / $divisor; | |
$new-top: $top / $divisor; | |
background-position: round($new-left) round($new-top); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment