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

fix(core): scope nested global selector issues #2925

Merged
merged 2 commits into from
Nov 21, 2023

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Nov 20, 2023

This pr fix the code that combines 2 selectors into a single selector in order to fix 2 bugs:

  • when nesting a global selector into a @st-scope, the parent selector is ignored
  • when mixining a JS mixin, any nested rule that starts with :global() is missing the mixed into selector

- properly scope global rules nested in st-scope atrule
- align js/css mixin behavior of adding the
@idoros idoros requested a review from barak007 November 20, 2023 11:49
@idoros idoros self-assigned this Nov 20, 2023
// merge scope flags
const nestStartWithNesting = first.type === `nesting`;
const nestedStartWithGlobal =
rootScopeLevel && first.type === `pseudo_class` && first.value === `global`;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change is here - the addition of rootScopeLevel && to limit the behavior of not prepending the parent scope for root mixins

@idoros idoros added bug Unexpected behavior or exception core Processing and transforming logic labels Nov 20, 2023
@idoros idoros merged commit 4dac04b into master Nov 21, 2023
12 checks passed
@idoros idoros deleted the ido/fix-scope-nested-selectors branch November 21, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or exception core Processing and transforming logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants