Skip to content
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

Tailwind size utility not working as expected #1372

Open
CodingSam opened this issue Mar 18, 2024 · 4 comments
Open

Tailwind size utility not working as expected #1372

CodingSam opened this issue Mar 18, 2024 · 4 comments

Comments

@CodingSam
Copy link

Describe the Bug

When using tailwind "size" classname, it is not recognised and results in class="size-X" in the html:
<div class="size-8">test</div>

Which package is affected (leave empty if unsure)

@react-email/tailwind

Link to the code that reproduces this issue

https://github.com/CodingSam/react-email-tailwind-size-bug

To Reproduce

  1. Add any Tailwind "size-X" eg. "size-8" className to a element / component
  2. run npm dev
  3. check the generated HTML version for class="size-8"

Expected Behavior

react-email should recognise the "size-X" classname and add the appropriate width and height style attributes. Link to tailwind "Size" documentation.

What's your node version? (if relevant)

No response

@gabrielmfern
Copy link
Collaborator

This is because we don't have the latest 3.4 version of Tailwind running, and since we only run our bundled version of it for the Tailwind component, we would need to update internally.

The issue with that is that the new versions of Tailwind require we use async APIs, and this could only be done with either support for server components or support for Suspense. So if we did update we would have to force users to either use renderAsync or bring in #1268 which is going to be a breaking change.

@CodingSam
Copy link
Author

Alright, thank you for clarifying. As a temp fix, we have temporary downgraded the version of "eslint-plugin-tailwindcss" to "3.13.0" so that it does not suggest / warn about classes that are not yet supported.

@arthurdotwork
Copy link

Any news there? We'd really like to use new Tailwind utilities. 🙏

@gabrielmfern
Copy link
Collaborator

gabrielmfern commented Sep 13, 2024

Should be fixed under @react-email/[email protected], a breaking change because it requires you use @react-email/render@>=1.0.0

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

No branches or pull requests

3 participants