-
Notifications
You must be signed in to change notification settings - Fork 16
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
Embedding Tailwind base styles #84
Comments
Sharing from my own experience, this is what I did
This allows you to use the css without including it in every single component |
Thank you for sharing your experience @webcodavic! I ended up using CSS modules and so far I'm happy with it. Even solving the problem of the preflight styles at layout level with Tailwind, as you demonstrated, I couldn't get around 2 other things:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I've been trialing Tailwind for styling with cms-react but I'm confused with the way of including Tailwind styles.
As suggested by the docs, I've been including the base styles at the top of my component, like this:
my tailwind.css being
But, if we do that to every single component using Tailwind in a Hubspot webpage, won't we eventually end up with duplicated styling/ unnecessarily large stylesheets? Defeating Tailwind's purpose in the first place.
Based on https://github.com/HubSpot/cms-react/tree/main/examples/styling, it seems that the best practice would be to inject base styles as part of a partial and then include islands/ modules as needed. I guess that would work but then the modules wouldn't be self-sufficient. I guess my end goal here would be to leverage Hubspot's Website pages drag & drop functionality, delegating some of that stuff to non technical staff while keeping my components granular and isolated. Am I making any sense?
Thank you
The text was updated successfully, but these errors were encountered: