postcss-extract-vars

PostCSS plugin PLUGIN_DESC

Usage no npm install needed!

<script type="module">
  import postcssExtractVars from 'https://cdn.skypack.dev/postcss-extract-vars';
</script>

README

postcss-extract-vars Build Status

PostCSS postcss-extract-vars Extracts the custom variables set to root scope and stores it in the file provided.

:root {
    --color-primary: red;
    --color-secondary: blue;
}
.button{

}
.others{

}
:root {
    --color-primary: red;
    --color-secondary: blue;
}

Usage

postcss([ require('postcss-extract-vars') ])

Options

{
    file: <PATH TO OUTPUT FILE>
}

See PostCSS docs for examples for your environment.