Rehype remove unused css
Rehype plugin to remove unused stylesheet with uncss
Installation
npm install rehype-remove-unused-css
Usage
Say example.html
looks as follows;
example
...and example.js
like this:
const vfile = const report = const unified = const rehype = const stringify = const removeUnusedCss =
Now, running node example
yields:
example
API
rehype().use(removeUnusedCss[, options])
Remove unused stylesheet.
options
is same as options of uncss
Security
Use of rehype-remove-unused-css should be safe to use as JSDOM should be safe to use. When in doubt, use rehype-sanitize.
License
MIT © TANIGUCHI Masaya