npm install --save electron-less
const eless = require('electron-less');
eless({
//options.source is required
source: 'styles.less',
//options.id is optional.
//options.id defaults to hasha(source)
id: 'myStyles',
//options.variables is optional
//options.variables gets turned into less variables
//that get prefixed to the options.source file text
variables: {
color: 'red'
},
//options.paths is optional
//option.paths specify search paths for @import directives
paths: ['.', './lib'],
}).then(()=>{
console.log('Styles appended to head element')
});
electron-less
uses less css preprocessor to parse .less
files, and appends that css to the head
in an electron view (electron Renderer Process).