Skip to content

Commit

Permalink
Add compact if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Igosuki committed May 10, 2015
1 parent f7e92b7 commit 8d93bef
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/compass/functions/_lists.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
//
// A partial implementation of the Ruby list functions from Compass:
// https://github.com/Compass/compass/blob/stable/lib/compass/sass_extensions/functions/lists.rb
//
//


// compact is part of libsass
Expand Down Expand Up @@ -75,4 +75,16 @@

@function first-value-of($list) {
@return nth($list, 1);
}
}

@if not(function-exists(compact)) {
@function compact($vars...) {
$list: ();
@each $var in $vars {
@if $var {
$list: append($list, $var, comma);
}
}
@return $list;
}
}

0 comments on commit 8d93bef

Please sign in to comment.