npm.io
1.2.2 • Published 2 years ago

postcss-for-css-vars

Licence
MIT
Version
1.2.2
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
2

PostCSS For Var Plugin

[PostCSS] plugin that enables @for loop syntax in your CSS with var.

Usage

postcss([ require('postcss-for-css-vars') ])
@for --i from 1 to 3 {
    .col-var(--i) { width: var(--i)px; }
}
.col-1 {
    width: 1px
}
.col-2 {
    width: 2px
}
.col-3 {
    width: 3px
}

This plugin must be set after postcss-nested and before postcss-css-variables/postcss-custom-properties.

See PostCSS docs for examples for your environment.

Keywords