list.from()

The list.from() function returns the list of elements from index $from to the end of $list.

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

// Functions.
@use 'list.nth.function' as *;

// Modules.
@use '../number';

// The `list.from()` function.
@function from($list, $from) {
  $result: nth($list, number.range($from, list.length($list)) or $from...);
  @return if(
    $from <= list.length($list),
    if(list.length($list) == $from, ($result,), $result),
    null
  );
}
https://github.com/angular-package/sass/blob/main/list/_list.from.function.scss

Parameters

$list

The list from which the elements are picked.

$from

A number-type element index of $list.

Return

The return value is the list of elements from index $from to the last index of $list.

Examples

Last updated

Was this helpful?