Skip to content

Calculate the difference between two sets of CSS stats

License

Notifications You must be signed in to change notification settings

bartveneman/css-analyzer-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

css-analyzer-diff

NPM Version Build Status Known Vulnerabilities Dependencies Status Dependencies Status XO code style Project: Wallace

Calculate the difference between two sets of CSS stats.

Usage

const differ = require("css-analyzer-diff");
const analyzeCss = require("@projectwallace/css-analyzer");

const [firstStats, secondStats] = await Promise.all([
  analyzeCss(".cat { color: brown; }"),
  analyzeCss(".cat { color: red; }")
]);
const changes = differ(firstStats, secondStats);

//=> Returns an object with all changes
// {
//   'values.colors.unique': [
//     {
//       value: 'brown',
//       removed: true,
//       added: false,
//       changed: true
//     },
//     {
//       value: 'red',
//       removed: false,
//       added: true,
//       changed: true
//     }
//  ],
//
//  ... many more ...
//
// }