Allow inspection of list size
This commit is contained in:
parent
cac1bf915f
commit
46eb667837
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user