Skip to content

bezoerb/stylediff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stylediff

Computes the difference of stylesheets at parse tree level to generate a "diff" stylesheet.

Deprecated in favour of https://github.com/bevacqua/cave

build status

Installation

This module is installed via npm:

$ npm install stylediff --save-dev

Example Usage

var stylediff = require('stylediff');
var fs = require('fs');

var css1 = fs.readFileSync('test/fixtures/styles_a1.css','utf8');
var css2 = fs.readFileSync('test/fixtures/styles_a2.css','utf8');
stylediff(css1,css2, function(err,out){
    fs.writeFileSync('test/fixtures/diff.css',out);
});

styles_a1.css:

.visible-print {
    display: none !important;
}

th.visible-print,
td.visible-print {
    display: table-cell !important;
    color: green;
}

styles_a2.css:

.visible-print {
    display: none !important;
}

td.visible-print {
    color: green;
}

th.visible-print {
    display: table-cell !important;
}

result.css:

td.visible-print {
    display: table-cell!important;
}

th.visible-print {
    color: green;
}

Options

Name Default Type Description
strict true boolean When set to false referenced images are compared to their inlined verions will be marked as equal declaration
cwd process.cwd() string Stylesheet directory - required when strict mode is false

About

Computes the difference of stylesheets at parse tree level to generate a "diff" stylesheet.

Resources

License

Stars

Watchers

Forks

Packages

No packages published