Skip to content

fix(tailwind): media-query stripping #2408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

PedroMarianoAlmeida
Copy link
Contributor

Solves #2388

Demo:

Screen.Recording.2025-08-03.at.11.47.05.PM.mov

Playground file added:

path: playground/emails/test-media-query-bug.tsx

import { Body, Head, Html, Text, Tailwind } from '@react-email/components';

const TestMediaQueryBug = () => {
  return (
    <Tailwind
      config={{
        darkMode: 'media',
        plugins: [
          ({ addUtilities }: any) => {
            addUtilities({
              '.text-body': {
                '@apply text-[green] dark:text-[orange]': {},
              },
            });
          },
        ],
      }}
    >
      <Html>
        <Head />
        <Body>
          <Text className="text-body">
            This text should be green in light mode and orange in dark mode
          </Text>
          <Text className="text-[green] dark:text-[orange]">
            This text uses inline classes and should work correctly
          </Text>
        </Body>
      </Html>
    </Tailwind>
  );
};

export default TestMediaQueryBug;

I can create tests if necessary!

@PedroMarianoAlmeida PedroMarianoAlmeida requested a review from a team as a code owner August 4, 2025 03:10
@PedroMarianoAlmeida PedroMarianoAlmeida requested review from CarolinaMoraes and removed request for a team August 4, 2025 03:10
Copy link

changeset-bot bot commented Aug 4, 2025

⚠️ No Changeset found

Latest commit: 9eb070e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Aug 4, 2025

@PedroMarianoAlmeida is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Aug 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/@react-email/tailwind@2408

commit: 9eb070e

@PedroMarianoAlmeida PedroMarianoAlmeida force-pushed the fix/media-query-stripping branch from 6518954 to b37d6ee Compare August 4, 2025 03:17
@PedroMarianoAlmeida PedroMarianoAlmeida changed the title fix/media-query-stripping fix(package>taiwind):media-query-stripping Aug 4, 2025
@PedroMarianoAlmeida PedroMarianoAlmeida changed the title fix(package>taiwind):media-query-stripping fix(package-tailwind): media-query stripping Aug 4, 2025
@PedroMarianoAlmeida PedroMarianoAlmeida force-pushed the fix/media-query-stripping branch from b37d6ee to 9eb070e Compare August 4, 2025 03:28
@gabrielmfern gabrielmfern changed the title fix(package-tailwind): media-query stripping fix(tailwind): media-query stripping Aug 4, 2025
@Zdend
Copy link

Zdend commented Aug 11, 2025

I appreciate you tackling this @PedroMarianoAlmeida 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants