惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog

Resend RSS Feed

6 Tips for Accessible Emails Welcoming Manoel do Amaral, our new Brand Designer Welcoming Michael Vaz, our new Customer Success Engineer Six Steps to Improve Your Sender Reputation Welcoming Tatira Andrade, our new Executive Assistant Welcoming Pedro Ivo Hudson, our new Design Engineer Welcoming Diel Duarte, our new Open source Engineer Welcoming Areia Spinner, our new Recruiter Resend Forward: A Conference about Craft React Email 6.0 Custom Tracking Domains AI Email Editor Introducing Automations Welcoming Ahmed Tolba, our new SRE Engineer Welcoming Aneil Singh, our new Founding Account Executive Welcoming Lucas Motta, our new Software Engineer Welcoming Trey Knowles, our new Founding Account Executive Welcoming Anxhela Carciu, our new SRE Engineer Introducing DMARC Analyzer Welcoming Evan Thibodeau, our new Customer Success Engineer Welcoming Derich Pacheco, our new Software Engineer Welcoming Alec Ventura, our new Data Engineer Welcoming Felipe Freitag, our new Software Engineer Welcoming Mateusz Wos, our new Software Engineer Incident report for February 15, 2026 Email automation for OpenClaw How to Create a DevTools Agent Skill Introducing Email Skills Why You Should Embrace the Promotions Tab Slater Smith, our new Customer Success Engineer
Improved Performance for Tailwind Emails
Gabriel Miranda · 2023-12-06 · via Resend RSS Feed

When we started react.email, the idea was to make modern web development tooling, like Tailwind CSS, available for the email ecosystem.

But for some time, the <Tailwind /> component had a few problems, leading users to go back into using inline styles. This is not the experience we wanted for developers.

That's why we're excited to announce a major performance improvement. The render time for Tailwind emails is now 23x faster.

~3681ms before and now 156ms
~3681ms before and now 156ms

These are numbers from benchmarks on real-world email templates.

Benchmark Results

We used the Tinybench library to run the tests. The tests were run on a Linux machine with a 3.6 GHz 6-core AMD Ryzen 5 4500 CPU and 16 GB 3600 MHz DDR4 memory.

The sample size was 100 email renders for each test, and the same email template was used for all the tests. The results are in nanoseconds per operation.

Here are the results before the performance improvements:

  • p75: 3385ms
  • p99: 3681ms

And here are the results after the performance improvements:

  • p75: 126ms
  • p99: 156ms

We can see that the p99 is 23x faster, and the p75 is 26x faster.

What changed

The greatest point of performance degradation that we had before was with the way we ran Tailwind to generate the styles for classes. Every time the component would come across a className, it would start tailwind alongside postcss, which was unnecessary.

To fix this, we changed the component to render the whole React element tree. Then, we ran Tailwind on it to know which inline styles to substitute for each class name.

We then created a map of the inline styles associated with the class names as keys. After that, we added these inline styles from the map to each element that uses these class names. This means the second traversal grows linearly instead of exponentially.

Upgrading to the new version

1. Upgrade package versions

If you are importing the Tailwind component from @react-email/components you can update it to version 0.0.12.

Or if you are importing it directly from @react-email/tailwind you can update it to version 0.0.13.

2. Change component order if you use media queries

If you are using Tailwind classes that renders into media queries like dark mode, you'll have to change the order in which the components are defined.

You need to move the Tailwind component from wrapping the <Html /> component followed by the <Head /> component to just directly wrapping the <Head /> component.

Conclusion

If you want to know more about this update, including technical details, and stability improvements, check the React Email Changelog.

If you have any problems upgrading, feel free to share on GitHub or X.