Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple $sprites declarations #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _retina-sprites.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "compass/css3/background-size"; // Include helper to calc background size


@mixin retina-sprite($name, $hover: false, $active: false) {
@mixin retina-sprite($name, $sprites, $sprites2x, $hover: false, $active: false) {
@include _retina-sprite($name, $sprites, $sprites2x, $hover, $active);
}

Expand All @@ -16,7 +16,7 @@
// if `pad` is non-zero, then that's how much padding the element will have (requires
// $spacing on the sprite maps). Great for iPhone interfaces to make hit areas bigger.
//
@mixin _retina-sprite($name, $sprites, $sprites2x, $hover, $active, $dimensions: true, $pad: 0) {
@mixin _retina-sprite($name, $sprites, $sprites2x, $hover, $active, $dimensions: true, $pad: 0) {
@if $dimensions == true {
@include sprite-dimensions($sprites, $name);
}
Expand All @@ -36,11 +36,11 @@
background-position: sprite-position($sprites, $name_active, -$pad, -$pad);
}
}

@if $pad > 0 {
padding: $pad;
}

@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
& {
$pos: sprite-position($sprites2x, $name, -$pad * 2, -$pad * 2);
Expand All @@ -50,7 +50,7 @@
// sprite-path() returns the path of the generated sprite sheet, which
// image-width() calculates the width of. the ceil() is in place in case
// you have sprites that have an odd-number of pixels in width

@if $hover == true {
$name_hover: $name + _hover; // create myButton_hover and assign it
&:hover{
Expand Down