Home › Forums › Other › SCSS, Using a variable in @each loop › Reply To: SCSS, Using a variable in @each loop
May 1, 2014 at 5:41 am
#168975
maikelkoopman
Participant
Thanks, Allen. I noticed this works only for Sass 3.3.
I just found a way for sass 3.2 (since I am using compass). It is less pretty but it works:
// headings
#{headings()} {
margin: 10px 0;
line-height: 1.5em;
}
$headings: h1, h2, h3, h4, h5, h6;
$size: $h1, $h2, $h3, $h4, $h5, $h6;
$head-size: zip($headings, $size);
@each $a in $head-size {
#{nth($a, 1)} {
font-size: nth($a, 2);
}
}