Skip to content

Instantly share code, notes, and snippets.

@metaskills
Created April 18, 2012 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save metaskills/2416795 to your computer and use it in GitHub Desktop.
Save metaskills/2416795 to your computer and use it in GitHub Desktop.
Custom Sass Function For stringinclude(a, b)
module Sass::Script
class String < Literal
def include?(other)
value.include? other.value
end
end
end
module Sass::Script::Functions
def stringinclude(str, value)
assert_type str, :String
assert_type value, :String
Sass::Script::Bool.new(str.include?(value))
end
declare :stringinclude, [:str, :value]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment