When I run "npm run dev" my node.js components are styled in the order:
- custom scss styling
- custom muiTheme.tsx
- then the component styles.
However, when I run "run build" + "npm run start" my node.js components are styled in the order:
- custom muiTheme.tsx
- then the component styles.
- custom scss styling
The order in which they are imported messes up the css as the custom styles are expected to be imported first. now it shows the styling in development of node.js correctly, but not in production, because my custom styling is overwritten by the default Mui styling.
I import my custom styling file and custom muitheme into the _app.tsx.
my custom styling file: styles/styles.scss
my custom mui theme: styles/muiTheme.tsx
I've tried switching the order of the files in _app.tsx, but it makes no difference. I also looked at my local version and tried to run it in production, but this didn't work either. My research didn't come up with a good answer that worked either.
related github issues: