Skip to content

fix: apply :global() to whole selector + add strict mode #8

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

Merged
merged 3 commits into from
Oct 31, 2020

Conversation

adrien-k
Copy link
Contributor

Fixing some issues when combining (pseudo)class selectors, ex: .test.test-2 {}, p.test { ... } , .test:over { ... }, etc...

@adrien-k adrien-k force-pushed the fix-combining-classes branch from 8854efa to de7d963 Compare October 21, 2020 12:58
@adrien-k adrien-k force-pushed the fix-combining-classes branch from de7d963 to ef7d3ac Compare October 21, 2020 14:08
@micantoine
Copy link
Owner

@adrien-k Thank you for your contribution. I updated the code so that it would work in some other scenarios such as:

  • Being used along other global selectors
<style>
 :global(div) .active { color: red; }
</style>
<div><span class="$style.active">Active</span></div>
  • Being used in a media query or nested rules (for sass)
<style>
 @media (min-width: 35.7em) {
  .active { color: red; }
 }
</style>
<span class="$style.active">Active</span>

Anything else you'd think of ?

@adrien-k
Copy link
Contributor Author

@micantoine That looks like a way better approach 👍. Thank you for the fix and for the lib.

@micantoine micantoine merged commit f070e7e into micantoine:master Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants