Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ashleahhill/6290223 to your computer and use it in GitHub Desktop.

Select an option

Save ashleahhill/6290223 to your computer and use it in GitHub Desktop.
I like the idea of compass magic selectors, but not the outputted class names.
// Include the selectors for the `$sprite` given the `$map` and the
// `$full-sprite-name`
// @private
@mixin sprite-selectors($map, $sprite-name, $full-sprite-name) {
@each $selector in $sprite-selectors {
@if sprite_has_selector($map, $sprite-name, $selector) {
@if $selector == [something normal]{
&:#{$selector}, &.is-#{$selector}{
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}");
}
}
@else {
&.is-#{$selector}{
@include sprite-background-position($map, "#{$sprite-name}_#{$selector}");
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment