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
// Sass.
@use 'sass:list';

// Status: DONE
// The `list.empty()` function returns the `bool` indicating whether the list is empty.
// @param `$list` The list to check against its length.
// @return The return value is a `bool` indicating whether the given `$list` is empty.
@function empty($list) {
  @return type-of($list) == list and list.length($list) == 0;
}

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

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

Was this helpful?