Inline Tailwind Emails
This tool helps you inline your Email templates that use Tailwind.
Usage
npm i inline-tailwind-emails
and inline a single file with:
const { inlineTailwindEmail } = require("inline-tailwind-emails");
const inlineHtml = await inlineTailwindEmail(
`
<link rel="stylesheet" href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css">
<div class="bg-red-500">
Hello World!
</div>
`,
{
url: "https://www.mywebsite.com"
}
);
or inline multiple files at once with:
const { inlineTailwindEmailFiles } = require("inline-tailwind-emails");
const results = await inlineTailwindEmailFiles(
[
"/path/to/file1.html",
"/path/to/file2.html",
"/path/to/file3.html"
],
{
url: "https://www.mywebsite.com"
}
);