0.1.2 • Published 5 years ago

email-css v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

email-css

Takes all <link rel="stylesheet"> tags in an HTML document and inlines them as <style> tags.

Useful for automatically inlining CSS in an email.

Usage

Install: npm i email-css

import { linksToStyles } from "email-css";

async function example() {
  // can use linksToInline() too
  console.log(await linksToStyles({
    url: "https://google.com"
  }));
  console.log(await linksToStyles({
    html: fs.readFileSync("./example.html", "utf-8"),
    rootUrl: "."
  }));
}