Skip to main content

empty ()

Creates an empty list with the specified characteristics or the characteristics of the specified list.

Parameters

$separator
The type of separator to be used by the empty list.
Type
space | comma | slash | auto
Default
comma
$bracketed
Whether the empty list has square brackets or no brackets.
Type
Boolean | auto
Default
false
$list
The list from which to determine separator and bracket style.
Type
List | ArgList<*>
Default
null

Return Value

List
An empty list with the given or derived characteristics.

Example

@use '@sass-fairy/list/list';

// 1. Create default empty list
$list: list.empty();

@debug list.separator($list);
// comma
@debug list.is-bracketed($result);
// false

// 2. Create empty with the same characteristics as source list
$list: list.empty($list: [1 2 3 4]);

@debug list.separator($list);
// space
@debug not list.is-bracketed($result);
// true