-
Notifications
You must be signed in to change notification settings - Fork 564
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
fix: Add :where selector to classes that land on nodes that have a sx prop #4870
Conversation
🦋 Changeset detectedLatest commit: 29465d6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Uh oh! @jonrohan, the image you shared is missing helpful alt text. Check your pull request body. Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image. Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/338618 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
This addresses a regression found in the last release of PRC https://github.com/github/github/pull/338276#issuecomment-2301557787
The problem is when the component has an
sx=
prop applied to it, the styled-components styles are being overridden by the CSS modules styles. This is because the two classes have equal specificity0,1,0
.The solution here is to add the
:where
selector to the CSS modules classes whenever they might exist on the same dom node as a sx prop. This will give the CSS modules classes a lower specificity0,0,0
and will prevent the styled-components styles from being overridden.Before
After
Changelog
Changed
Add
:where()
selector to classes that land on nodes that have asx
prop.Rollout strategy
Testing & Reviewing
I'm going to test this locally, then also on a review-lab instance.
Merge checklist