list.range()

The list.range() function returns the list from the $list of range $from to $to.

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

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

// Modules.
@use '../math';

// The `list.range()` function.
@function range($list, $from: 1, $to: list.length($list)) {
  @return nth($list, (math.range(($from, $to, 1, 0)...) or $to)...);
}
https://github.com/angular-package/sass/blob/main/list/_list.range.function.scss

Parameters

$list

The list to retrieve the elements from range $from to $to.

$from: 1

Index from which retrieving elements begins.

$to: list.length($list)

Index where the retrieval of elements ends.

Return

The return value is the list of range $from to $to.

Examples

Last updated

Was this helpful?