Next.js Discord

Discord Forum

weird tailwind overrides

Unanswered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
hey guys I built a react component package that uses tailwindcss (and radixui) and published it on npm.

When I install and import the package in my nextjs app (that also uses tailwindcss) it has screwed up styles (obviously) but when i also import the styles.css from dist/ folder of the component package inside my project, the styles for the component get fixed but it screws with the rest of tailwind styles in my project (most noticeable are the responsive screen modifiers where i hide parts on mobile and desktop with lg:hidden for eg)

what is happening here? Are the tailwind classes from my nextjs app getting overriden somehow?

for more info, I tried this on 3 different projects, one is react vite, and other two are next 12 and next 13 (all use tailwind). It happens on both of the next projects while everything is ok with vite one.

0 Replies