Snippet for adding tailwind inline to load the ui with styles the first time itself #54677
Unanswered
Mihir-Karbelkar
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone. I use tailwind with next to build components but the issue I have had is with the first render with just a white document being shown if the css doesnt load in time or slight flash. To fix this I thought of writing a component for inline styles so the document itself will have the correct styles the first time it is loaded, thus contributing to a better UX.
This is for anyone wanting to achieve the same with tailwind. I would also like to have feedback on how I can improve this better because right now it will create style tag for all css files inside the directory, which is not what you need always.
The important thing is that this goes in to the root layout.
Beta Was this translation helpful? Give feedback.
All reactions