-
Notifications
You must be signed in to change notification settings - Fork 27
/
_to-string.scss
46 lines (39 loc) · 963 Bytes
/
_to-string.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
///
/// Joins all elements of `$list` with `$glue`.
///
/// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-to-string
///
/// @param {List} $list - list to cast
/// @param {String} $glue [''] - value to use as a join string
///
/// @requires sl-has-multiple-values
/// @requires sl-last
///
/// @example
/// sl-to-string(a b c)
/// // abc
///
/// @example
/// sl-to-string(a b c, '-')
/// // a-b-c
///
/// @return {String}
///
@function sl-to-string($list, $glue: '') {
$_: sl-missing-dependencies('sl-has-multiple-values');
$result: '';
@each $item in $list {
$result: $result + if(sl-has-multiple-values($item), sl-to-string($item, $glue), $item);
@if $item != sl-last($list) {
$result: $result + $glue;
}
}
@return quote($result);
}
///
/// @requires sl-to-string
/// @alias sl-to-string
///
@function sl-stringify($list, $glue: '') {
@return sl-to-string($list, $glue);
}