css-inline

Blazing-fast WASM package for inlining CSS into HTML documents.
Features:
- Removing
style
tags after inlining; - Resolving external stylesheets (including local files);
- Control if
style
tags should be processed; - Additional CSS to inline;
- Inlining multiple documents in parallel (via Rust-level threads)
The project supports CSS Syntax Level 3 implemented with Mozilla's Servo project components.
Usage
import { inline } from "css-inline";
var inlined = inline(
`
<html>
<head>
<title>Test</title>
<style>h1 { color:red; }</style>
</head>
<body>
<h1>Test</h1>
</body>
</html>
`,
{ remove_style_tags: true }
)