-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
with-tailwindcss example double include of globals breaks styling #1809
Comments
see the following upstream discussions: vercel/turborepo#1809 vercel/turborepo#2554 vercel/turborepo#2308
#65) see the following upstream discussions: vercel/turborepo#1809 vercel/turborepo#2554 vercel/turborepo#2308
How about prefix the classname so it does not conflicting using the tailwind configuration prefix option? |
@kriswuollett we ended up using the prefix option for the ui lib in our tailwind example to avoid this issue. The example is up to date now and should fix this! |
Won't prefixing cause having duplicate classes in the final CSS bundle for the NextJS app? Suppose, we are using the
|
What version of Turborepo are you using?
1.4.3
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Linux
Describe the Bug
The shared
ui
component includes tailwindcss globals overrides the sample app's globals.css, when both are included in the app. This can cause issues like masking abutton
's background color (also breaks the search bar layout in the Card layout with sidebar example). Note the missing teal "Send money" button that should be next to "Add money" on the right hand side, and the order of css imports is user agent, global, global, styles:Expected Behavior
The examples should show proper reuse of tailwind/css in a shared UI package.
I'm not sure what the best solution is, but perhaps in the short term it includes:
ui
and assuming those globals are includedLonger term perhaps:
app
should demonstrate extending the theme fromui
, e.g., more theme colorsTo Reproduce
Not sure at the moment, because merely adding something like the following to the examples index.tsx below the current button seems to work due to the differing import order:
Note order of CSS imports is: user agent, globals, styles, globals.
The text was updated successfully, but these errors were encountered: