Skip to content

Instantly share code, notes, and snippets.

@perplexes
Created December 11, 2015 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perplexes/e0e75f00b3772f2bf643 to your computer and use it in GitHub Desktop.
Save perplexes/e0e75f00b3772f2bf643 to your computer and use it in GitHub Desktop.
$ sassc test.scss
.fun-exists1 {
exists: false;
compact: true; }
.fun-exists2 {
exists: false;
compact: compact(true); }
@if not function-exists(compact) {
@function compact($vars...) {
$list: ();
@each $var in $vars {
@if $var {
$list: append($list, $var, comma);
}
}
@return $list;
}
.fun-exists1 {
@if function-exists(compact) {
exists: true;
}
@else {
exists: false;
}
compact: compact(true);
}
}
.fun-exists2 {
@if function-exists(compact) {
exists: true;
}
@else {
exists: false;
}
compact: compact(true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment