Module: Compass::SassExtensions::Functions::ColorStop

Included in:
Sass::Script::Functions
Defined in:
lib/compass/sass_extensions/functions/color_stop.rb

Instance Method Summary collapse

Instance Method Details

#color_stop(*args) ⇒ Object

Raises:

  • (Sass::SyntaxError)


2
3
4
5
6
7
8
9
# File 'lib/compass/sass_extensions/functions/color_stop.rb', line 2

def color_stop(*args)
  raise Sass::SyntaxError, "An even number of arguments must be passed to color-stop()" unless args.size % 2 == 0
  stops = []
  while args.size > 0
    stops << "color-stop(#{args.shift}, #{args.shift})"
  end
  Sass::Script::String.new(stops.join(", "))
end