Skip to content

Instantly share code, notes, and snippets.

@MarkLavrynenko
Created December 22, 2014 18:37
Show Gist options
  • Save MarkLavrynenko/5c91955f8ec333268694 to your computer and use it in GitHub Desktop.
Save MarkLavrynenko/5c91955f8ec333268694 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<ul>
<li class="item1">Text 1</li>
<li class="item2">Some text 2</li>
<li class="item3">Dota 2</li>
<li class="item4">Moon</li>
</ul>
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$colors : red, green, blue, #B0B;
$i:1;
ul li {
@each $col in $colors {
&.item#{$i} {
color : $col;
}
$i : $i + 1;
}
}
ul li.item1 {
color: red;
}
ul li.item2 {
color: green;
}
ul li.item3 {
color: blue;
}
ul li.item4 {
color: #B0B;
}
<ul>
<li class="item1">Text 1</li>
<li class="item2">Some text 2</li>
<li class="item3">Dota 2</li>
<li class="item4">Moon</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment