Pass through offset parameters to the :hover, :target, and :active magic sprite selectors.
This commit is contained in:
parent
71d8111454
commit
7e07e55f13
@ -30,18 +30,18 @@ $disable-magic-sprite-selectors:false !default;
|
||||
@include sprite-dimensions($map, $sprite);
|
||||
}
|
||||
@if not $disable-magic-sprite-selectors {
|
||||
@include sprite-selectors($map, $sprite, $sprite);
|
||||
@include sprite-selectors($map, $sprite, $sprite, $offset-x, $offset-y);
|
||||
}
|
||||
}
|
||||
|
||||
// Include the selectors for the `$sprite` given the `$map` and the
|
||||
// `$full-sprite-name`
|
||||
// @private
|
||||
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name) {
|
||||
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name, $offset-x: 0, $offset-y: 0) {
|
||||
@each $selector in $sprite-selectors {
|
||||
@if sprite_has_selector($map, $sprite-name, $selector) {
|
||||
&:#{$selector}, &.#{$full-sprite-name}_#{$selector}, &.#{$full-sprite-name}-#{$selector} {
|
||||
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}");
|
||||
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}", $offset-x, $offset-y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user