Skip to content

worm-emoji/stylesheet-differ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stylesheet-differ

CircleCI npm

stylesheet-differ is a npm module that outputs the difference of two stylesheets as valid css.

It works on small and large stylesheets alike, and powers the diffing capabilities of StyleURL.

Generally speaking, it's a wrapper on top of cssobj with some hacks to generate styles.

Removed rules and attributes result in attr: unset in the output.

Usage

import differ from 'stylesheet-differ'

const styleA = `body {
  color: blue;
  background-color: red;
}`;

const styleB = `body {
  color: red;
}`

const changes = differ(styleA, styleB);

//  body {
//    color: red;
//    background-color: unset;
//  }

About

Outputs the difference of two stylesheets as valid css

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published