From 8d93bef3e982cba3420bd16c04a99fabf4e3399e Mon Sep 17 00:00:00 2001 From: Guillaume Balaine Date: Sun, 10 May 2015 13:26:56 +0200 Subject: [PATCH] Add compact if not defined --- lib/compass/functions/_lists.scss | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/compass/functions/_lists.scss b/lib/compass/functions/_lists.scss index c4a8b1d..dadb5a9 100644 --- a/lib/compass/functions/_lists.scss +++ b/lib/compass/functions/_lists.scss @@ -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 @@ -75,4 +75,16 @@ @function first-value-of($list) { @return nth($list, 1); -} \ No newline at end of file +} + +@if not(function-exists(compact)) { + @function compact($vars...) { + $list: (); + @each $var in $vars { + @if $var { + $list: append($list, $var, comma); + } + } + @return $list; + } +}