title: Sass if inside each
body: <p>I'm trying to get specific selectors from the following list, to have two properties, and all the other selectors, have a single property.</p>
  
  <p>I tried the following code, but it seems, every selector, gets both properties defined on the class inside the if function.</p>
  
  <pre><code>$items: (one 20% 30%) (two 12% 24%) (three 34% 32%) (four 45% 50%);
  
  @each $item in $items {
    @if #{nth($item, 1)} == one or three {
      .#{nth($item, 1)} {
        left: #{nth($item, 2)};
        bottom: #{nth($item, 3)};
      }
    } @else {
      .#{nth($item, 1)} {
        left: #{nth($item, 2)};
      }
    }
  }
  </code></pre>
  
  <p>The result I'm trying to achieve is:</p>
  
  <pre><code>.one {
    left: 20%;
    bottom: 30%;
  }
  
  .two {
    left: 12%;
  }
  
  .three {
    left: 34%;
    bottom: 32%;
  }
  
  .four {
    left: 45%;
  }
  </code></pre>