Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# config/initializers/compass_patch.rb
module Compass::SassExtensions::Functions::Sprites
# Returns boolean if sprite has the selector
def sprite_has_selector(map, sprite, selector)
sprite = convert_sprite_name(sprite)
verify_map map
verify_sprite sprite
unless VALID_SELECTORS.include?(selector.value)
raise Sass::SyntaxError, "Invalid Selctor did you mean one of: #{VALID_SELECTORS.join(', ')}"
end
Sass::Script::Bool.new map.send(:"has_#{selector.value}?", sprite.value)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.