Skip to content
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

use :not(:has(...)) to resolve subtree specificity issues when using CSS vars #43887

Closed
wants to merge 1 commit into from

Conversation

rossipedia
Copy link

@rossipedia rossipedia commented Sep 25, 2024

I believe we can leverage :not(:has(...)) to resolve the specificity issues outlined in #43824, as the selector should only match the parent that does not have a child element with a conflicting theme selector applied to it.

Resolves #43824

Exampe

rossipedia added a commit to rossipedia/mui-css-vars-with-patch that referenced this pull request Sep 26, 2024
@zannager zannager added the customization: theme Centered around the theming features label Sep 26, 2024
@rossipedia
Copy link
Author

After more investigation, this will not work as expected, and will remove theme.applyStyles(...) from applying based on the root theme selector.

@rossipedia rossipedia closed this Oct 2, 2024
@rossipedia rossipedia deleted the css-vars-subtree-selectors branch October 2, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customization: theme Centered around the theming features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS Vars Theme not applying correct styles when using nested/forced color schemes
2 participants