-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Custom base style specificity problem when importing #1057
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
Comments
If you're using https://tailwindcss.com/docs/using-with-preprocessors#build-time-imports |
I'm not using |
Yeah this is likely a Parcel issue then. In my experience Parcel is basically entirely broken when it comes to working with CSS :/ If you can create a GitHub repo that reproduces the issue in a simple way I'm happy to take a look but I'm basically 100% certain this is an issue with how Parcel works with it's own magic import system instead of using postcss-import. |
Yeah I'm inclined to agree with you. The rest of my team loves Parcel for its simplicity, but I keep running into these kinds of issues :( I think Parcel is prepending all the imports at the top of the bundled file, hence screwing with the order. This naturally isn't a problem with my component files, since in general they have higher specificity. |
Hopefully they tackle this feature request in Parcel soon, as it would make it very easy for them to solve the import problem: It's really a shame because Parcel is such a nice way to work compared to webpack, but this issue is a huge show stopper :( |
According to the docs here: https://tailwindcss.com/docs/adding-base-styles/, you can define base element styles by adding them directly after
@tailwind base
.This only seems to work when these base styles are added directly in the same file. If I
@import
a separate css file with base styles, they seem to be added before Tailwind's base styles, thus overriding many of my styles.Example:
This, however, works as expected:
Am I missing something?
The text was updated successfully, but these errors were encountered: