# File lib/compass/sass_extensions/functions/gradient_support.rb, line 82 def initialize(position, shape_and_size, color_stops) unless color_stops.value.size >= 2 raise Sass::SyntaxError, "At least two color stops are required for a radial-gradient" end if angle?(position) raise Sass::SyntaxError, "CSS no longer allows angles in radial-gradients." end self.position = position self.shape_and_size = shape_and_size self.color_stops = color_stops end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 78 def children [color_stops, position, shape_and_size].compact end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 129 def to_css2(options = self.options) Sass::Script::String.new("") end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 107 def to_owg(options = self.options) args = [ grad_point(position || _center_position), Sass::Script::String.new("0"), grad_point(position || _center_position), grad_end_position(color_stops, Sass::Script::Bool.new(true)), grad_color_stops(color_stops) ] args.each {|a| a.options = options} Sass::Script::String.new("-webkit-gradient(radial, #{args.join(', ')})") end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 124 def to_pie(options = self.options) Compass::Logger.new.record(:warning, "PIE does not support radial-gradient.") Sass::Script::String.new("-pie-radial-gradient(unsupported)") end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 94 def to_s(options = self.options) s = "radial-gradient(" s << position.to_s(options) << ", " if position s << shape_and_size.to_s(options) << ", " if shape_and_size s << color_stops.to_s(options) s << ")" end
# File lib/compass/sass_extensions/functions/gradient_support.rb, line 119 def to_svg(options = self.options) # XXX Add shape support if possible radial_svg_gradient(color_stops, position || _center_position) end