fix(app): inject emotion styles before legacy JSS styles - #1115
Open
bitsbeyond wants to merge 1 commit into
Open
fix(app): inject emotion styles before legacy JSS styles#1115bitsbeyond wants to merge 1 commit into
bitsbeyond wants to merge 1 commit into
Conversation
Emotion (MUI v7) appended its stylesheets after the JSS ones generated by @mui/styles, so every legacy withStyles/makeStyles rule with equal specificity lost to the component defaults. Visible symptoms included the missing gap between the connection dialog title and its URL and tab labels rendering in the wrong case. StyledEngineProvider injectFirst restores the intended cascade for the whole app. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Author
|
Same CI situation as #1114: all Actions jobs fail inside |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Emotion (MUI v5+) appends its stylesheets to
<head>after the JSS stylesheets generated by the legacy@mui/styleswithStyles/makeStyles. With equal selector specificity the emotion rules win, so every legacy JSS override in the app silently stops applying.Visible symptoms include:
marginLeftfromwithStylesis ignored),Fix
Wrap the app in
StyledEngineProvider injectFirst, the interop setup MUI documents for codebases that still use@mui/styles. Emotion styles then land first in<head>and the JSS overrides win again, restoring the cascade the components were written against.Verification
Checked computed styles via DevTools before/after (e.g. the dialog URL
marginLeft: 32pxreturns).yarn test:appunchanged (103 passing, 4 pre-existing failures).🤖 Generated with Claude Code