Replies: 2 comments 6 replies
-
@ScriptedAlchemy Anything obvious that I'm missing to do here? |
Beta Was this translation helpful? Give feedback.
0 replies
-
No known ways to control css ordering. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I have 2 MFE apps - a Host and an UI library exposing components.
Host is bootstrapped with create-react-app. Both containers are using CSS modules.
In the Host, I want to override a UI component's styles by providing a custom
className
via prop.Before Module Federation, the CSS chunks were loaded in the following order:
Button.module.scss
HostComponent.module.scss
With Module Federation, I assume because the Button is loaded asynchronously, the Button's CSS is loaded secondly.
Because of CSS modules and the locally scoped class names having the same priority there is an unexpected override of styles.
Is there any workaround to this or just in general tips/advices on how to design such components (having CSS modules in mind and locally scoped class names)?
To note that this is only reproducible in the production build (so when CSS files are extracted by
mini-css-extract-plugin
. In dev mode (which usesstyle-loader
) this is not an issue, which is kind of weird too..Thanks!
Beta Was this translation helpful? Give feedback.
All reactions