Allow inspection of list size

This commit is contained in:
Chris Eppstein 2010-11-15 17:28:20 -08:00
parent cac1bf915f
commit 46eb667837

View File

@ -14,6 +14,9 @@ module Compass::SassExtensions::Functions::GradientSupport
def to_s
values.map {|v| v.to_s }.join(join_with)
end
def size
values.size
end
end
class SpaceList < List
@ -317,6 +320,10 @@ module Compass::SassExtensions::Functions::GradientSupport
SpaceList.new(*values)
end
def _compass_list_size(list)
Sass::Script::Number.new(list.size)
end
# Get the nth value from a list
def _compass_nth(list, place)
if place.value == "last"