0.1.2 • Published 5 years ago

@vsr/css-to-js v0.1.2

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

CSS to JS

This module converts CSS code to JS code, such that running the JS code in browser would apply the styles defined by the CSS code.

This is helpful when you can't or don't want to add or insert a style tag but would like to apply the styles.

Install

npm i @vsr/css-to-js

CLI

npx @vsr/css-to-js -i my-css-file.css -o css-embed.js

API

const fs = require('fs');
const { cssToJs } = require('@vsr/css-to-js');

const css = fs.readFileSync('./test/styles/pure-min.css').toString();
console.log(cssToJs(css));

TODO

  • develop api
  • write tests
  • develop script generator
  • develop cli interface
0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago