Stylecow v3.1.0 Release Notes

    • Implemented source maps
    • ๐Ÿ‘Œ Improved error handling. Now on error, a stylecow.Error() class is throwed
    • ๐Ÿ’… Changed the way the code is generated. Now there is the stylecow.Code class. For example:
    var stylecow = require('stylecow');
    
    //Get some code
    var css = stylecow.createFromFile('my-styles.css');
    
    //Configure the code
    var code = new stylecow.Code(css, {
        output: 'styles.min.css', //output filename
        style: 'minify', //minify the code
        sourceMap: 'styles.min.map',  //The source map file
        previousSourceMap: 'styles.map' //Set this value if there is the file has a source map created by other preprocessor, such less/sass and it's not defined in the code.
    });
    
    //Save the output css file and source map
    code.save();
    
    //Get the code as string:
    console.log(code.code);
    
    //Get the source map
    console.log(code.map)
    
    • ๐Ÿ†• New stylecow.merge() function to merge two files: ```js var main_css = stylecow.createFromFile('styles1.css'); var other_css = stylecow.createFromFile('styles2.css');

    //Merges "other_css" into "main_css" stylecow.merge(main_css, other_css);