Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 848 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 848 Bytes

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