0.3.0 • Published 3 years ago

get-css-variables v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

get-css-variables

Import 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

In your code:

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

0.3.0

3 years ago

0.2.0

3 years ago

0.1.3

3 years ago

0.1.0

4 years ago

0.0.3

4 years ago