Class List
Hierarchy
- List
Index
Constructors
Methods
Constructors
constructor
Creates a new Sass list.
⚠️ Heads up!
The initial values of the list elements are undefined. These elements must be set using setValue before accessing them or passing the list back to Sass.
Parameters
length: number
The number of (initially undefined) elements in the list.
Optional commaSeparator: boolean
If
true
, the list is comma-separated; otherwise, it's space-separated. Defaults totrue
.
Returns List
Methods
get Length
Returns the number of elements in the list.
Returns number
get Separator
Returns
true
if this list is comma-separated andfalse
otherwise.Returns boolean
get Value
Returns the element at
index
, orundefined
if that value hasn't yet been set.Parameters
index: number
A (0-based) index into this list.
Returns undefined | LegacyValue
set Separator
Sets whether the list is comma-separated.
Parameters
isComma: boolean
true
to make the list comma-separated,false
otherwise.
Returns void
set Value
Sets the element at
index
tovalue
.Parameters
index: number
A (0-based) index into this list.
value: LegacyValue
Returns void
Sass's list type.
⚠️ Heads up!
This list type’s methods use 0-based indexing, even though within Sass lists use 1-based indexing. These methods also don’t support using negative numbers to index backwards from the end of the list.