postcss-implicit-var

PostCSS plugin that places `var()` around variable references

Usage no npm install needed!

<script type="module">
  import postcssImplicitVar from 'https://cdn.skypack.dev/postcss-implicit-var';
</script>

README

PostCSS Implicit Var Build Status

PostCSS plugin that places var() around variable references.

Using either $ or -- to prefix the variable name is supported.

Existing declarations are left alone.

.foo {
    color: $red-lighten-2
    color: --red-lighten-2
}
.foo {
  color: var(--red-lighten-2)
  color: var(--red-lighten-2)
}

Usage

postcss([ require('postcss-implicit-var') ])

See PostCSS docs for examples for your environment.