Skip to content

Instantly share code, notes, and snippets.

@mattdrose
Created February 9, 2015 17:34
Show Gist options
  • Save mattdrose/64a609bbe33b446080bd to your computer and use it in GitHub Desktop.
Save mattdrose/64a609bbe33b446080bd to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
@import "compass/css3";
@function remove($list, $value, $recursive: false) {
$result: ();
@for $i from 1 through length($list) {
@if type-of(nth($list, $i)) == list and $recursive {
$result: append($result, remove(nth($list, $i), $value, $recursive));
}
@else if nth($list, $i) != $value {
$result: append($result, nth($list, $i));
}
}
@return $result;
}
@function join($list, $glue: "", $trim: true, $is-nested: false) {
$result: null;
@if $trim {
$list: remove($list, "", true);
$list: remove($list, null, true);
}
@for $i from 1 through length($list) {
$e: nth($list, $i);
@if type-of($e) == list {
$result: $result#{join($e, $glue, $trim true)};
}
@else {
$result: if($i != length($list) or $is-nested, $result#{$e}#{$glue}, $result#{$e});
}
}
@return $result;
}
.test {
@include transition(opacity .25s ease);
}
List index is 1 but list has no items for `nth'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment