Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akashdotsrivastava/compare-css
Test whether two pieces of CSS text are equivalent in browser
https://github.com/akashdotsrivastava/compare-css
comparison-tool css equivalence-checker
Last synced: about 1 month ago
JSON representation
Test whether two pieces of CSS text are equivalent in browser
- Host: GitHub
- URL: https://github.com/akashdotsrivastava/compare-css
- Owner: akashdotsrivastava
- License: mit
- Created: 2022-02-19T12:59:35.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-20T10:31:25.000Z (almost 3 years ago)
- Last Synced: 2024-10-13T18:08:36.350Z (2 months ago)
- Topics: comparison-tool, css, equivalence-checker
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/compare-css
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# compare-css
Tests whether two pieces of CSS text are equivalent.
## Installation
Using npm:
npm install compare-css
Using yarn:
yarn add compare-css
## Usage
```javascript
import isEquivalentCss from "compare-css";console.log(isEquivalentCss("p { border: 1px; }", "p { border: 2px; }"));
// => falseconst css1 = `
.a {
color: red;
height: 100px;
}
.b {
color: red;
background-color: white;
height: 30px;
}
`;const css2 = `
.b {
height: 30px;
background-color: white;
}
.a {
height: 100px;
}
.b,
.a {
color: red;
}
`;console.log(isEquivalentCss(css1, css2));
// => true
```