Styles not applying on front-end #87
Replies: 2 comments
-
After taking one by one all of the existing issue I found that many are related It seems to be that the first is there something I miss? |
Beta Was this translation helpful? Give feedback.
-
Hello again! I think the documentation section on arbitrary classes in the block editor should address your question; please take a look and let me know! _tw uses Tailwind's own approach to optimizing for production, so the purging of unused styles is intended. For the client work that I do, I wouldn't want clients to be adding any of their own classes in the block editor. Instead, I create custom blocks or patterns with the appropriate classes, and the HTML for those blocks or patterns is somewhere in my project repository where Tailwind can pick up the classes so they're included. I'll convert this to a discussion in case you have any other questions! |
Beta Was this translation helpful? Give feedback.
-
I gave on purpose the same name as #64
Things might be related (or might not)
I am using this theme and mostly the Website does look like Tailwind is correctly being applied.
However
When, in a page, I add a "Custom HTML" block like
In the front-end I see only the <a URL like Some Text and there is no button visible.
If I add exactly the same piece of code on another (static) Tailwind website I see a nice looking Tailwind button.
Initially I thought that this is happening because I use the
npm run prod
command which, at build time, is stripping from the production css and js "the CSS and JS code which is not being used" and then, when I use some special CSS classes in the front-end custom HTML blocks, most of the tailwind css was stripped off duringnpm run prod
and is not being available anymore.It might work if instead of
npm run prod
I usenpm run dev
?Then I also found the existing #64 and I though that this might happen also.
Is this a bug or it is something which I don't understand about _tw?
Beta Was this translation helpful? Give feedback.
All reactions