svgdom-css
v0.2.7
Published
Include custom CSS along svgdom.
Downloads
840
Readme
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