Created
November 6, 2012 16:16
-
-
Save myabc/4025755 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# 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