list.join()
The list.join() returns a new list containing the elements of $list1 followed by the elements of $list2.
// Sass.
@use 'sass:list';
// The `list.join()` function.
@function join(
$list1,
$list2,
$separator: auto,
$bracketed: auto,
$delimiter: null
) {
@if $delimiter {
$list: ();
$i: 1;
@each $value in list.join($list1, $list2, $separator, $bracketed) {
$list: list.append($list, $value, $separator);
@if not(calc(list.length($list1) + list.length($list2)) == $i) {
$list: list.append($list, $delimiter, $separator);
}
$i: $i + 1;
}
@return $list;
}
@return list.join($list1, $list2, $separator, $bracketed);
}https://github.com/angular-package/sass/blob/main/list/_list.join.function.scss
Parameters
$list1
$list1 The list to join elements of $list2.
$list2
$list2The list to be joined into $list1.
$separator: auto
$separator: autoComma, space, or slash separator used between the elements of the list. Default, auto.
$bracketed: auto
$bracketed: autoIf true then returned list is between the square brackets.
$delimiter: null
$delimiter: nullThe delimiter is the character added as an element between each element in the returned list.
Return
The return value is a new list containing the elements of $list1 followed by the elements of $list2.
Examples
Last updated
Was this helpful?