# stylesheet-differ

> [![CircleCI](https://circleci.com/gh/lukemiles/stylesheet-differ/tree/master.svg?style=svg)](https://circleci.com/gh/lukemiles/stylesheet-differ/tree/master) [![npm](https://img.shields.io/npm/v/stylesheet-differ.svg)](https://www.npmjs.com/package/styles

Latest version **0.0.21** (published 2018-07-30) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install stylesheet-differ
pnpm add stylesheet-differ
yarn add stylesheet-differ
bun add stylesheet-differ
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.21 |
| Published | 2018-07-30 |
| First published | 2018-07-14 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 185.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luke Miles |
| Maintainers | lukemiles |

## Links

- npm: https://www.npmjs.com/package/stylesheet-differ
- Repository: https://github.com/lukemiles/stylesheet-differ
- Homepage: https://github.com/lukemiles/stylesheet-differ#readme
- Issues: https://github.com/lukemiles/stylesheet-differ/issues
- npm.io page: https://npm.io/package/stylesheet-differ

## Dependencies (4)

- [cssobj](https://npm.io/package/cssobj.md) ^1.3.6
- [cssobj-core](https://npm.io/package/cssobj-core.md) ^1.1.9
- [cssobj-converter](https://npm.io/package/cssobj-converter.md) ^2.3.3
- [cssobj-plugin-gencss](https://npm.io/package/cssobj-plugin-gencss.md) ^2.0.7

## Recent versions

- 0.0.21 (latest) — 2018-07-30
- 0.0.20 — 2018-07-30
- 0.0.12 — 2018-07-29
- 0.0.11 — 2018-07-29
- 0.0.10 — 2018-07-28
- 0.0.9 — 2018-07-27
- 0.0.8 — 2018-07-26
- 0.0.7 — 2018-07-26
- 0.0.6 — 2018-07-26
- 0.0.5 — 2018-07-20
- 0.0.3 — 2018-07-14
- 0.0.2 — 2018-07-14
- 0.0.1 — 2018-07-14

## README

# stylesheet-differ

[![CircleCI](https://circleci.com/gh/lukemiles/stylesheet-differ/tree/master.svg?style=svg)](https://circleci.com/gh/lukemiles/stylesheet-differ/tree/master) [![npm](https://img.shields.io/npm/v/stylesheet-differ.svg)](https://www.npmjs.com/package/stylesheet-differ)

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](https://www.styleurl.app).

Generally speaking, it's a wrapper on top of [cssobj](https://github.com/cssobj/cssobj) with some hacks to generate styles.

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

## Usage

```js
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;
//  }
```

---
_Source: https://npm.io/package/stylesheet-differ · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
