postcss-foreach

0.0.3 • Public • Published

postcss-foreach Build Status

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.

Package Sidebar

Install

npm i postcss-foreach

Weekly Downloads

2

Version

0.0.3

License

MIT

Last publish

Collaborators

  • verybigman