svgdom-css

0.2.7 • Public • Published

Include custom CSS along svgdom.

I was using this to use chartist on node.js.


const css = require('svgdom-css');
const fs = require('fs');
/* (a default window is defined) */
// css(<css string>)
// -> window

var customcss = '.ct-label { font-family: Courier; font-weight: bold; }';
var window1 = css(customcss);
// -> window

var path = require.resolve('chartist/dist/chartist.min.css');
var window2 = css(fs.readFileSync(path, 'utf8'));
// -> window

var window3 = css(customcss + fs.readFileSync(path, 'utf8'));
/* (css overloading not supported, custom css must be included first!) */
// -> window


References

Readme

Keywords

Package Sidebar

Install

npm i svgdom-css

Weekly Downloads

250

Version

0.2.7

License

MIT

Unpacked Size

4.33 kB

Total Files

4

Last publish

Collaborators

  • wolfram77