list.append()

The modified list.append() function returns a copy of $list with $val added and/or with multiple $values added to the end.

The function is modified by adding arbitrary values to the end of the parameters to preserve the original functionality.

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

// The `list.append()` function.
@function append($list, $val, $separator: auto, $values...) {
  @each $value in list.join(($val,), $values, comma) {
    $list: list.append($list, $value, $separator);
  }
  @return $list;
}
https://github.com/angular-package/sass/blob/main/list/_list.append.function.scss

Parameters

$list

The list to append the $val and/or $values into.

$val

The value to append to the end of $list.

$separator

The separator comma, space or slash of the list. Default, auto.

$values...

Additional values to append into $list.

Return

Returns a copy of $list with $val and/or $values added to the end.

Examples

Last updated

Was this helpful?