You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/components/tailwind.mdx
+6-56Lines changed: 6 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,13 +170,13 @@ const Email = () => {
170
170
## Known limitations
171
171
172
172
<AccordionGroup>
173
-
<Accordiontitle="Support up to Tailwind v3.3.2">
174
-
Due to an internal technical limitation, we are still running on Tailwind `3.3.2`. This is
175
-
because Tailwind migrated into using async APIs internally after [`3.3.3`](https://github.com/tailwindlabs/tailwindcss/releases/tag/v3.3.3)
176
-
and the only way we can migrate is by using Suspense on the Tailwind component which would
177
-
force everyone into using only `renderAsync`.
173
+
<Accordiontitle="No support for contexts inside the component">
174
+
Currently adding a context's provider inside of the Tailwind component, won't allow you
175
+
to properly call the `useContext` in any of the children of it, due to some technical limitations
176
+
regarding on how we currently map the classNames into styles.
178
177
179
-
You can track our progress on [this issue](https://github.com/resend/react-email/issues/1372).
178
+
The current workaround for this right now is to move the context's provider higher than the Tailwind
179
+
component, so that all children inside Tailwind can properly call `useContext` with the context.
180
180
</Accordion>
181
181
<Accordiontitle="No support for prose from @tailwindcss/typography">
182
182
We do not yet support `prose`, and beyond that, we don't yet support classes that might
@@ -196,54 +196,4 @@ do the same for `hover:` styles though, but since [their support is not best](ht
196
196
In the future, we will be inlining all the styles we can by actually matching the
197
197
selectors *against the elements* themselves.
198
198
</Accordion>
199
-
<Accordiontitle="Limitations when trying to manipulate classes">
200
-
Currently, the component works, at a high level, going through the following steps:
201
-
202
-
1. Do a very surface-level rendering on the children to have something resembling the HTML
203
-
2. Run `tailwind` as a `postcss` plugin in the new fake rendered email template to generate a CSS stylesheet with all the styles of the template
204
-
3. Generate a map of all the class names pointing to their respective styles
205
-
4. Run recursively through all elements, and their children, by looking up class by class to add the appropriate styles to it while removing the classes
206
-
207
-
The biggest cause of limitation here is going to be `1.`. Since that fake rendering process does not render
208
-
the components, that means that, if a class name doesn't appear in the resulting HTML, it won't have
209
-
its style either, so the class isn't removed. Here's an example:
0 commit comments