Raise an error if color stops are specified in the wrong order.
Closes GH-118.
This commit is contained in:
parent
df447b5d6c
commit
910083b2f7
@ -177,6 +177,14 @@ module Compass::SassExtensions::Functions::GradientSupport
|
||||
end
|
||||
end
|
||||
end
|
||||
# Make sure the color stops are specified in the right order.
|
||||
positions.inject do |last_pos, pos|
|
||||
puts pos.inspect
|
||||
if last_pos.stop.value > pos.stop.value
|
||||
raise Sass::SyntaxError.new("Color stops must be specified in increasing order")
|
||||
end
|
||||
pos
|
||||
end
|
||||
# normalize unitless numbers
|
||||
positions.each do |pos|
|
||||
if pos.stop.unitless? && pos.stop.value <= 1
|
||||
|
Loading…
Reference in New Issue
Block a user