Skip to content

Commit

Permalink
fix(list): fix list.index() function - remove checking type of `$li…
Browse files Browse the repository at this point in the history
…st`.
  • Loading branch information
sciborrudnicki committed Dec 1, 2023
1 parent 6587c4d commit bece908
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions list/_list.index.function.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
// @return The return value is an index or list of indexes of the given values.
@function index($list, $value, $values...) {
$result: ();
@if type-of($list) == list {
@each $value in append((), $value, auto, $values...) {
$result: if(list.index($list, $value), append($result, list.index($list, $value), comma), $result);
}
@each $value in append((), $value, auto, $values...) {
$result: if(list.index($list, $value), append($result, list.index($list, $value), comma), $result);
}
@return if(list.length($result) > 0, if(list.length($result) == 1, list.nth($result, 1), $result), null);
}
Expand Down

0 comments on commit bece908

Please sign in to comment.