list.last()

The list.last() function returns the last element of $list.

// Sass.
@use 'sass:list';

// The `list.last()` function.
@function last($list) {
  @return list.nth($list, list.length($list));
}

Parameters

$list

The list to get the last element from.

Return

The return value is the last element of $list.

Examples

// Use.
@use 'angular-package/sass/list';

// Examples.
@debug list.last(('a', 'b', c, d, 2, 4, 5, (a: 1))); // (a: 1)

Last updated