Sass set-nth() Function
You are Here:
Sass set-nth() Function
The set-nth()
function returns a copy of a list with the element at the specified index replaced with a given value.
If the specified index value is negative, it counts from the end of a list. Throws an error if there is no existing element at the specified index.
Example
SASS TO CSS CONVERTER
.foo{
margin: set-nth(10px 20px 30px, 1, 2em);
margin: set-nth(10px 20px 30px, -1, 8em);
}
Syntax
set-nth($list, $n, $value)
Parameter Value
Value | Type | Explanation |
---|---|---|
$list | Required | Specifies a list. |
$n | Required | Specifies the index value in the list.
|
$value | Required | Specifies the new value to replace the old value. |
Return Value
Value | Explanation |
---|---|
list | Returns a copy of $list with the element at index $n replaced with $value. |
Reminder
Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Sass.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.