Module: Compass::SassExtensions::Functions::CrossBrowserSupport
- Included in:
- Sass::Script::Functions
- Defined in:
- lib/compass/sass_extensions/functions/cross_browser_support.rb
Defined Under Namespace
Classes: CSS2FallbackValue
Instance Method Summary collapse
- #css2_fallback(value, css2_value) ⇒ Object
- #prefix(prefix, *objects) ⇒ Object
-
#prefixed(prefix, *args) ⇒ Object
Check if any of the arguments passed require a vendor prefix.
Instance Method Details
#css2_fallback(value, css2_value) ⇒ Object
66 67 68 |
# File 'lib/compass/sass_extensions/functions/cross_browser_support.rb', line 66 def css2_fallback(value, css2_value) CSS2FallbackValue.new(value, css2_value) end |
#prefix(prefix, *objects) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/compass/sass_extensions/functions/cross_browser_support.rb', line 46 def prefix(prefix, *objects) prefix = prefix.value if prefix.is_a?(Sass::Script::String) prefix = prefix[1..-1] if prefix[0] == ?- if objects.size > 1 self.prefix(prefix, Sass::Script::List.new(objects, :comma)) else object = objects.first if object.is_a?(Sass::Script::List) Sass::Script::List.new(object.value.map{|e| self.prefix(prefix, e) }, object.separator) elsif object.respond_to?(:supports?) && object.supports?(prefix) && object.respond_to?(:"to_#{prefix}") object. = object.send(:"to_#{prefix}") else object end end end |
#prefixed(prefix, *args) ⇒ Object
Check if any of the arguments passed require a vendor prefix.
30 31 32 33 34 |
# File 'lib/compass/sass_extensions/functions/cross_browser_support.rb', line 30 def prefixed(prefix, *args) aspect = prefix.value.sub(/^-/,"") needed = args.any?{|a| a.respond_to?(:supports?) && a.supports?(aspect)} Sass::Script::Bool.new(needed) end |