list.first()
The list.first() function returns the first element of $list.
// Sass.
@use 'sass:list';
// The `list.first()` function.
@function first($list) {
@return if(type-of($list) == list, list.nth($list, 1), $list);
}https://github.com/angular-package/sass/blob/main/list/_list.first.function.scss
Parameters
$list
$list The list to get the first element from.
Return
The return value is the first element of $list.
Examples
Last updated
Was this helpful?