Tailwind v4 Breakpoints Broken in Gmail: Why and How to Fix
Tailwind v4 up to 4.3.2 nests each breakpoint inside its class rule, and Gmail does not support CSS nesting. Upgrade to react-email 6.9.1 or later, or flatten the rules to min-width queries and convert oklch colours in your own build.
Works in 5 of 21. Not supported in Outlook Classic and Thunderbird. Partial in Gmail, Gmail Android, Gmail iOS and 11 more.
Every client by level
- Works
- Apple Mail, Apple Mail iOS, HEY Mail, Fastmail, Superhuman
- Partial
- Gmail, Gmail Android, Gmail iOS, Outlook 365, Outlook (New), Outlook iOS, Outlook Android, Outlook for Mac, Yahoo Mail, Yahoo Mail Android, Yahoo Mail iOS, Samsung Mail, Proton Mail, AOL Mail
- Not supported
- Outlook Classic, Thunderbird
No signup · Five clients free, Outlook Classic included · All 21 with an account
The checker needs a computer screen.
A free account opens all 21 clients and keeps your checks for 7 days. Create a free account →
Philippe Kam, founder of Emailens · Published 19 Mar 2026 · Updated 8 Nov 2026
@emailens/engine 0.18.22 · data last changed 10 Nov 2026
Part of the HTML email guide · all guides
Your email looks right in the preview, then Gmail readers get the desktop layout on their phones, or a card with no colour and no padding. Tailwind v4 writes CSS that browsers read and Gmail throws away. Here is what it writes, what to upgrade, and what to fix if you build the CSS yourself.
The fix for React Email: react-email 6.9.1 or later
React Email fixed this upstream in two steps. In react-email 6.0.7 (May 2026, PR #3086), the <Tailwind> component started flattening nested media rules and rewriting range queries as min-width and max-width. In 6.9.1 (July 2026, PR #3674), it caught up with Tailwind 4.3.3, which changed the shape of its output. On an older version with Tailwind 4.3.3 or later, dark: and sm: values are inlined as the base style and the @media rule is dropped: dark colours show in light mode, and the mobile layout shows on desktop.
The @react-email/components and @react-email/tailwind packages are deprecated on npm. The components now ship in react-email:
npm uninstall @react-email/components @react-email/tailwind
npm install react-email@latest # 6.9.1 or later
// before
import { Tailwind } from "@react-email/components";
// after
import { Tailwind } from "react-email";The component also converts oklch colours to comma rgb() and resolves CSS variables. One case stays nested on purpose: a pseudo-class rule such as &:hover, which the downleveling leaves as it is.
What Tailwind v4 writes, and what each client does with it
Up to 4.3.2, a breakpoint utility compiles to this. Every browser reads it. Three things in it fail in email:
/* Tailwind v4 up to 4.3.2: @media nested in the rule, range syntax */
.sm\:bg-red-300 {
@media (width >= 40rem) {
background-color: var(--color-red-300); /* oklch(80.8% 0.114 19.571) */
}
}- The nesting. The
@mediarule sits inside the selector. Gmail, Outlook and Yahoo do not support CSS nesting. Yahoo and AOL remove the nested selector, so its properties apply to the parent selector instead. Tailwind 4.3.3 and later wrap the rule in the@mediainstead, which removes this problem for breakpoints. - The range syntax.
(width >= 40rem)is Media Queries Level 4. In our real-device probe of 14 October 2026, the Gmail app on an Android 9 phone, Apple Mail on an iPhone 13 and an older Apple Mail on Mac all ignored(width < 9999px), while(max-width: 9999px)applied on all three. Older rendering engines do not read the new form, and some of your readers are on one. - The colour. The palette is oklch, behind a CSS variable. Gmail supports neither.
Gmail, cell by cell, from the Emailens engine's data:
- Not supportednesting is not supported in Gmail.Tailwind up to 4.3.2 nests every sm:, md: and dark: rule. Flatten it before it ships.
- Partial@media is partly supported in Gmail.Kept in the head, for width queries. Gmail's apps drop the <style> block for accounts that are not Google accounts.
- Not supportedmodern-color is not supported in Gmail.oklch() is Tailwind v4's default palette. In a style attribute it removes every inline style on the element.
- Partialrgb is partly supported in Gmail.The space syntax, rgb(0 0 0 / 1), removes the whole <style> block. Write it with commas.
- Not supportedcustom-properties is not supported in Gmail.Tailwind v4 references var(--color-…) for every colour. Resolve the variables at build time.
If you build the CSS yourself: what the output must look like
A custom pipeline that calls Tailwind's compile().build() and puts the result in a <style> tag skips the step that downlevels CSS for browsers. Before the CSS reaches an email, make four changes:
- Move each nested
@mediato the top level, with the selector inside it. - Rewrite range queries:
(width >= 40rem)becomes(min-width: 40rem), and(width < 40rem)becomes(max-width: 40rem). - Replace every
var()with its value. - Convert oklch and space-separated
rgb()to hex or commargb().
/* What every client can read: flat, min-width, a plain colour */
@media (min-width: 40rem) {
.sm_bg-red-300 {
background-color: rgb(255, 162, 162) !important;
}
}The colour step matters as much as the breakpoints, because Gmail's failure is bigger than one property:
<!-- Gmail drops every inline style on this cell, padding included -->
<td style="padding: 24px; background-color: oklch(96.7% 0.003 264.542);">
<!-- Gmail removes this whole <style> block -->
<style>
.card { background-color: rgb(248 250 252 / 1); }
.btn { padding: 12px 24px; }
</style><td style="padding: 24px; background-color: #f3f4f6;">
<style>
.card { background-color: rgb(248, 250, 252); }
.btn { padding: 12px 24px; }
</style>The space-separated colour is the cause in two public Maizzle threads (#824, #1192) where production builds lost their styles in Gmail. Emailens flags both forms as errors and counts the elements affected.
Downleveling gets the media queries back, but Gmail keeps the <style> block only in the head and within a size limit; see what Gmail's sanitizer keeps. For how breakpoints fit a mobile-first email layout, see the responsive email design guide, and for other React Email and jsx-email rendering bugs, the React Email troubleshooting guide.
Questions
Why do Tailwind v4 breakpoints break in Gmail?
Tailwind v4 up to 4.3.2 writes each breakpoint as an @media rule nested inside the class rule, in the range syntax: .sm\:p-4 { @media (width >= 40rem) { … } }. Gmail does not support CSS nesting, so the breakpoint never applies. React Email fixed this in react-email 6.0.7 by flattening the rule and rewriting it as (min-width: 40rem).
Which react-email version fixes Tailwind v4 in Gmail?
react-email 6.9.1 or later. 6.0.7 added the downleveling of nested and range media queries. 6.9.1 fixed Tailwind 4.3.3 and later, whose new output made older versions inline dark: and sm: values as base styles and drop the @media rule. The old @react-email/components and @react-email/tailwind packages are deprecated, so import Tailwind from react-email.
Does Gmail support oklch() colours from Tailwind v4?
No. Can I Email reports that a modern colour function such as oklch() in a style attribute makes Gmail remove every inline style on that element. A space-separated rgb(0 0 0 / 1) in a <style> block makes Gmail remove the whole block. Convert colours to hex or comma rgb() at build time. React Email's Tailwind component already does.
Do I still need CSS inlining when using Tailwind for emails?
Yes. Gmail's apps drop the <style> block for accounts that are not Google accounts, and Gmail keeps <style> only in the head, up to 16KB. Inline base styles, and keep only the media queries in the <style> block.
Your next question
Also useful: CSS Inliner · Test React Email templates · Lint Maizzle templates in 21 clients
Paste the email that broke.
No signup · Five clients free, Outlook Classic included · All 21 with an account
The checker needs a computer screen.
Get new email CSS fixes by email, or follow by RSS.