1

I want to be able to compare an item against a list, to see if the current item exists in the list, like so:

$elements: one two three four five;
$picked: two five;

@for $i from 1 through length($elements) {
  @if not index($picked, nth($elements, $i)) == false {
  }
}

Or is there a better way to do this?

4

1 回答 1

1

Nevermind, I should RTFM more often. There's the index() function that returns false if it doesn't exists in the list

于 2013-05-05T19:32:51.500 回答