-
Notifications
You must be signed in to change notification settings - Fork 239
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
Implementing tailwindcss #376
Comments
I'd like to add that some tailwind classes work but strangely someother ones don't. I minimal sample of that is this component: <button class={ normally it should display a yellow tone in the background but this specific color only works with bg-yellow-500, some other classes are the same not recognized by the editor but some other ones work. |
Having this issue too! still looking for a fix! Have been trying tailwind JIT mode, but haven't gotten anything to work yet. |
React live will support any css classes you pass to the component, but Tailwind is not built-in to the component itself so your host site must supply the Tailwind framework.
If you are just trying random TW classes on the documentation page, that will not work since we precompile only the TW classes we specifically use on the site in order to reduce the HTML payload. |
I have the same issue. My project has tailwind, not sure how to include all possible standard classes in the precompile so i can use any of them with live rendering, any suggestions? |
I'd suggest you to find a workaround mixing tools like clsx and tailwind-merge, I hope it works for you! here there's an idea of how you could implement it by yourself :) https://medium.com/@naglaafouz4/enhancing-component-reusability-in-tailwind-css-with-clsx-and-tailwind-merge-986aa4e1fe76 |
Do you think adding safelists in the Tailwind configuration to preserve the essential TW classes could be a viable solution? I understand this might significantly increase the CSS file size, but it would ensure that the classes aren't purged. For instance:
Or do you see a better solution? |
This worked for me, but the build time increases exponentially FYI module.exports = {
safelist: [
{
pattern: /./,
},
],
} Alternatively, you can choose a subset: module.exports = {
safelist: [
{
pattern: /^(bg|text|border|p|m|w|h)-.+/,
},
],
} |
It would be nice to be able to add tailwind styling to it.
The text was updated successfully, but these errors were encountered: