-
Notifications
You must be signed in to change notification settings - Fork 10
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
bug: css class order changes at using useTheme in MarigoldProvider #1317
Comments
The variant and custom styles are overridden by reset.base styles (css class css-ase7ea). The order is changed (current guess) by using the useTheme hook in the MarigoldProvider. |
'@emotion/react' and '@emotion/css' are not good at working together. We found out that this combination changes the order of the css styles. One solution is to remove the css() function from emotion/css which is used in reset.ts |
Still trying to find a solution for this. The current problem is that the GlobalStyles cannot be replaced by changing the theme. You should set GlobalStyles which are replaced by another theme globals (not added) |
We found out that the best way is to deepmerge alle styles inside useStyles or inside useClassname. |
I would definitely go for option 3, a.k.a. putting everything in the correct order with a deepmerge in useStyles. |
I would also go for this option. |
@viktoria-schwarz @ti10le that option doesn't use a deep merge, if you referring to this doc: https://github.com/marigold-ui/marigold/blob/global-css-with-separate-caches/packages/system/src/issues.md The deepmerge is causing the problem. It solves the ordering issue and creates an issue with overriding props. See example. Option: is basically the current implementation, but making sure the styles are inverted in the correct order. And the question remains: how! |
Ok as I see it we have one option where we don't have string classnames anymore and use css prop and two options where we have to clarify an important open question - how do we implement this. 🤔 |
moved everthing here: https://github.com/marigold-ui/marigold/discussions/1372 |
Description
The css class order changes if you are using useTheme() hook in MarigoldProvider. (this was recognized at #1197)
How to reproduce
Steps to reproduce the behavior:
Expected behavior
Css classes should be the same order in local dev mode, local production (gatsby serve) and live.
Screenshots
The text was updated successfully, but these errors were encountered: