list.empty()

The list.empty() function returns the bool indicating whether the list is empty.

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

// The `list.empty()` function.
@function empty($list) {
  @return type-of($list) == list and list.length($list) == 0;
}

Parameters

$list

The list to check against its length.

Return

The return value is a bool indicating whether $list is empty.

Examples

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

// Examples.
@debug list.empty(()); // true
@debug list.empty((1, )); // true
@debug list.empty((a: 1)); // false

Last updated