set

set

Return a new list, based on the list provided, but with the nth element changed to the value given.

Note that unlike some languages, the first item in a Sass list is number 1, the second number 2, and so forth.

Negative index values address elements in reverse order, starting with the last element in the list.

Examples:

set-nth($list: 10px 20px 30px, $n: 2, $value: -20px) => 10px -20px 30px

Parameters:

  • $list (Base) The list that will be copied, having the element at index $n changed.
  • $n (Number) The index of the item to set. Negative indices count from the end of the list.
  • $value (Base) The new value at index $n.

Returns:

  • (List)

Raises:

  • (ArgumentError) if $n isn’t an integer between 1 and the length of $list
doc_Sass
2016-11-11 13:09:25
Comments
Leave a Comment

Please login to continue.