Skip to content
This repository was archived by the owner on Aug 13, 2019. It is now read-only.

Structuralapp/email-css

Repository files navigation

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: "."
  }));
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published