https://github.com/openstax/css-coverage.js
:art: Code Coverage for your CSS!
https://github.com/openstax/css-coverage.js
coverage css css-coverage
Last synced: 4 months ago
JSON representation
:art: Code Coverage for your CSS!
- Host: GitHub
- URL: https://github.com/openstax/css-coverage.js
- Owner: openstax
- Created: 2014-01-04T19:36:01.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T19:12:05.000Z (over 3 years ago)
- Last Synced: 2025-10-18T09:03:32.371Z (8 months ago)
- Topics: coverage, css, css-coverage
- Language: JavaScript
- Homepage:
- Size: 1.11 MB
- Stars: 24
- Watchers: 9
- Forks: 3
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CSS Coverage!
[](https://greenkeeper.io/)
Generates coverage information of your CSS files and creates reports using the optional source maps.
## How is this different from other CSS coverage tools?
- gives coverage information on your source files (SASS/LESS/Stylus/etc), not just the compiled CSS file
- provides a command line script to run against individual test files
## What can I do with `css-coverage`?
You can use the command line version to:
- test a CSS and HTML file one at a time
- use `css-coverage` as part of a build (like in GruntJS)
- generate a LCOV Report for use in services like [Coveralls](http://coveralls.io) or HTML reports using `lcov`
### Can I make Reports?
You can also generate LCOV Files for Coveralls or just HTML reports:
# Run CSS Coverage and generate a LCOV report (with verbose output)
css-coverage --css ./test/test.css --html ./test/test.html --lcov ./css.lcov
# Optionally Generate an HTML report
genhtml ./css.lcov --output-directory ./coverage
## Commandline Options
```txt
Usage: css-coverage [options]
Generate coverage info for a CSS file against an HTML file. This supports loading sourcemaps by using the sourceMappingURL=FILENAME.map CSS comment
Options:
--html [path/to/file.html] path to a local HTML file
--css [path/to/file.css] path to a local CSS file
--lcov [path/to/output.lcov] the LCOV output file
--verbose verbose/debugging output
--ignore-source-map disable loading the sourcemap if one is found
--ignore-declarations [move-to,content] A comma-separated list of declarations to ignore
-h, --help output usage information
```