Package that parses a css file with a :root pseudoselector with custom properties to a json object
$ npm install @rogal/custom-properties-to-json --save-dev
You'll need to create a css file with a :root pseudoselector
:root {
--primary-bg-color: blue;
--color: #ffffff;
}
After creating the file create a task or execute the command
custom-properties-to-json input=src/styles/base-theme.css output=src/styles/variables/base-theme.json
This will create a json with the next structure
[
{
"property": "--primary-bg-color",
"value": "blue"
},
{
"property": "--color",
"value": "#ffffff"
}
]