-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
CSS order messed up after build #9733
Comments
Same here! In development i see everything right but after build all styles are messed... |
The only workaround I did for now is I make sure in my css I code to be more specific :
to
just to make sure its sorted highest in css precedence level. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
As far as I know, this issue still exists. |
Yes, still having the same issue. |
I am seeing this issue as well. I would have thought using CSS modules would protect from this, but I guess it is more an issue of which order the imports happen than having scoped stylesheets? |
I published a fix for this where we're not code splitting CSS which should solve the problems y'all are facing. Please update to gatsby@2.1.3 and lemme know if you're still having troubles! |
Still have this issue in April 2019. |
Same here with Gatsby 2.4 |
Some debugging notes: I've encountered this too. I tried to do I found that whenever I was doing Related: |
I've found more issues in my project, and fixing these led to fixing the CSS issue. I have my CSS imported in a file called What fixed it for me
Why is this a problem?
|
I was running into this issue on gatsby@2.3.5, but I'm pretty sure my cause was because I had followed the instructions here for replacing third party modules at build time with Well that module I was replacing includes it's own styles. In development everything worked great, I had my own styles that were overriding that modules styles. But in production, since that module gets skipped effectively, when it loads up in the browser, then it's styles get imported (after all my other styles), so overriding wasn't working. My current workaround isn't great but it works, I'm just adding |
@rstacruz Thank you! 🙏 The import order was what was causing this for us. |
Hi everyone, I have an issue where my css is either missing or order is messed up after I build.
For example:
This is the development one.

And this is one after I build

My way of working is I use traditional way of writing in CSS file and import './index.css' into my component.
Is there anything I can do to fix this? Thank you!
The text was updated successfully, but these errors were encountered: