Skip to content

Commit 8d93bef

Browse files
committed
Add compact if not defined
1 parent f7e92b7 commit 8d93bef

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/compass/functions/_lists.scss

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
//
1+
//
22
// A partial implementation of the Ruby list functions from Compass:
33
// https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/lists.rb
4-
//
4+
//
55

66

77
// compact is part of libsass
@@ -75,4 +75,16 @@
7575

7676
@function first-value-of($list) {
7777
@return nth($list, 1);
78-
}
78+
}
79+
80+
@if not(function-exists(compact)) {
81+
@function compact($vars...) {
82+
$list: ();
83+
@each $var in $vars {
84+
@if $var {
85+
$list: append($list, $var, comma);
86+
}
87+
}
88+
@return $list;
89+
}
90+
}

0 commit comments

Comments
 (0)