Mailwind Save

Use Tailwind CSS to design HTML emails.

Project README


Use Tailwind CSS to design HTML emails.

Tailwind makes it very easy to design websites, why not use it to design HTML emails? I've been using this for and and it has made my life a lot easier.


npm install -g mailwind


Design your HTML email using the Tailwind utility classes like you normally would for the web.

Then run the following command to generate the corresponding CSS file:

mailwind --input-html email.html --output-css style.css

Or run this command to generate an inlined HTML file:

mailwind --input-html email.html --output-html email-inlined.html



The path to your base CSS file. Use this if you need to write custom CSS. Defaults to style.css.


The path to your HTML email file.


The path to the CSS file that will be generated.


The path to the inlined HTML file that will be generated.


The path to your custom Tailwind configuration file. Defaults to tailwind.config.js.


In the provided default config file, all the units are changed to pixel which is probably what you want for HTML emails.


Given an email.html file with this content:

    <p class="font-bold text-lg">Welcome</p>

running this command:

mailwind \
  --input-html email.html \
  --output-css style.css \
  --output-html email-inlined.html

will generate the following CSS and inlined HTML files:

.text-lg {
  font-size: 18px

.font-bold {
  font-weight: 700
    <p class="font-bold text-lg" style="font-size: 18px; font-weight: 700;">Welcome</p>

Version History

  • 2.0
    • New design
    • Upgrade to Tailwind CSS v3
  • 1.0
    • Initial release


Soheil Rashidi

Copyright 2022 Soheil Rashidi.

Licensed under the The MIT License (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Open Source Agenda is not affiliated with "Mailwind" Project. README Source: soheilpro/mailwind
Open Issues
Last Commit
7 months ago

Open Source Agenda Badge

Open Source Agenda Rating