Skip to content

Commit

Permalink
feat 👍 add slice function
Browse files Browse the repository at this point in the history
  • Loading branch information
synchrovision committed Mar 7, 2022
1 parent 9576e4b commit 5807144
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/_basic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,18 @@
@if type-of($alpha) == 'number'{@return rgba(tint($clr,$tint),$alpha);}
@if type-of($tint) == 'number'{@return tint($clr,$tint);}
@return $clr;
}

@function slice($list,$start:1,$end:length($list)){
$rtn:();
@if $start < 0 {
$start: length($list) + $start;
}
@if $end < 1 {
$end: length($list) + $end;
}
@for $i from $start through $end {
$rtn:append($rtn,nth($list,$i));
}
@return $rtn;
}

0 comments on commit 5807144

Please sign in to comment.