Sass List Func
# Sass List Functions
[ Sass Functions](#)
Sass List functions are used to process lists, which can access values in lists, add elements to lists, merge lists, etc.
Sass lists are immutable, so when processing lists, a new list is returned instead of modifying the original list.
The starting index value of a list is 1, remember not 0.
The following table lists Sass's list functions:
| Function | Description & Example |
| --- | --- |
| append(_list_, _value_, ) | Adds a single value _value_ to the end of the list. _separator_ is the separator, which is automatically detected by default, or can be specified as comma or space. **Example:**append((a b c), d) Result: a b c d append((a b c), (d), comma) Result: a, b, c, d |
| index(_list_, _value_) | Returns the index position of element _value_ in the list. **Example:** index(a b c, b) Result: 2 index(a b c, f) Result: null |
| is-bracketed(_list_) | Determines whether the list has brackets **Example:** is-bracketed() Result: true is-bracketed(a b c) Result: false |
| join(_list1_, _list2_, [_separator, bracketed_]) | Merges two lists, appending list _list2_ to the end of list _list1_. _separator_ is the separator, which is automatically detected by default, or can be specified as comma or space. _bracketed_ automatically detects whether there are brackets by default, can be set to true or false. **Example:** join(a b c, d e f) Result: a b c d e f join((a b c), (d e f), comma) Result: a, b, c, d, e, f join(a b c, d e f, $bracketed: true) Result: |
| length(_list_) | Returns the length of the list **Example:** length(a b c) Result: 3 |
| list-separator(_list_) | Returns the separator type of a list. Can be space or comma. **Example:** list-separator(a b c) Result: "space" list-separator(a, b, c) Result: "comma" |
| nth(_list_, _n_) | Gets the value of the nth item. **Example:** nth(a b c, 3) Result: c |
| set-nth(_list_, _n_, _value_) | Sets the value of the nth item in the list to _value_. **Example:** set-nth(a b c, 2, x) Result: a x c |
| zip(_lists_) | Combines multiple lists into a new multi-dimensional list, grouping values with the
YouTip