Skip to main content

join ()

Concatenates all of the items in a list to a string, separated by the list’s separator or a specified glue string. If the list has only one item, then that item will be returned without using the glue.

Parameters

$list
The list to join.
Type
List
$glue
The string to separate each pair of adjacent items of the list. The value is converted to a string if necessary.
Type
String
Default
%derived%

Return Value

String
A string with all list items joined.

Example

@use '@sass-fairy/list';

@debug list.join([10px 20px 'a']);
// '10px 20px a'

@debug list.join([10px, 20px, 'a']);
// '10px, 20px, a'