get-css-variables

1.0.0 • Public • Published

Get CSS variables

Convert your CSS variables into a JavaScript Object

Build npm

Run CLI via npx

npx get-css-variables inputFile.css output.js

Usage

npm install --save-dev get-css-variables

Node Api

Convert css variables into a JSON object:

const { getVariables } = require("get-css-variables");

console.log(getVariables(":root { --dummy-color: blue }"));

Output

{ "--dummy-color": "blue" }

CLI

Will create an output file containing a exported javascript module.

$ get-css-variables inputFile.css output.js

Limits

  • Only variables on the :root selector are supported.

Development

$ npm install
$ npm run build
$ npm test

Note

Readme

Keywords

Package Sidebar

Install

npm i get-css-variables

Weekly Downloads

1,550

Version

1.0.0

License

MIT

Unpacked Size

5.54 kB

Total Files

5

Last publish

Collaborators

  • oloff