postcss-foreach
v0.0.3
Published
PostCSS plugin to iterate through values
Downloads
5
Maintainers
Readme
postcss-foreach
A PostCSS plugin to iterate through values.
$array: (foo, bar, baz);
@each $val, $i in s, m, l {
.icon_size_$(val) {
background: url('icons/$(array[$i]).png');
}
}
.icon_size_s {
background: url('icons/foo.png');
}
.icon_size_m {
background: url('icons/bar.png');
}
.icon_size_l {
background: url('icons/baz.png');
}
Usage
postcss([ require('postcss-foreach') ])
See PostCSS docs for examples for your environment.