0.0.0 • Published 4 years ago

postcss-root-to-json v0.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

PostCSS Root To Json

PostCSS plugin Exports all root declarations to json.

:root {
    --custom-color: #fff;
}

:root {
    --custom-size: 2em;
}
{ 
  "--custom-color": "#fff",
  "--custom-size": "2em"
}

Usage

Add the output path as an option: { output: \'output.json\' }

Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you already use PostCSS, add the plugin to plugins list:

module.exports = {
  plugins: [
+   require('postcss-root-to-json'),
    require('autoprefixer')
  ]
}

If you do not use PostCSS, add it according to official docs and set this plugin in settings.