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;
}
https://github.com/angular-package/sass/blob/main/list/_list.empty.function.scss

Parameters

$list

The list to check against its length.

Return

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

Examples

Last updated

Was this helpful?