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

Selecting specific element also applies pseudo state to all its descendants alternate #85

Conversation

JonathanKolnik
Copy link
Contributor

@JonathanKolnik JonathanKolnik commented Aug 7, 2023

📦 Published PR as canary version: 2.1.1--canary.85.0bc3584.0

✨ Test out this PR locally via:

npm install storybook-addon-pseudo-states@2.1.1--canary.85.0bc3584.0
# or 
yarn add storybook-addon-pseudo-states@2.1.1--canary.85.0bc3584.0

Related to #56

This PR modifies withPseudoState at the step of applying classes to a root element.

Before it would apply the same class, .pseudo-[state], to any element. This meant there was no way to distinguish whether or not this class was written due to a boolean pseudo: { hover: true, } or a specific selector pseudo: { hover: ["#foo"], }

Now that there is this distinction in place, a pseudo effect that is applied to a specific selector will no longer unintentionally apply to that selector's descendants.

@JonathanKolnik JonathanKolnik marked this pull request as ready for review August 8, 2023 13:31
@JonathanKolnik JonathanKolnik force-pushed the 56-selecting-specific-element-also-applies-pseudostate-to-all-its-descendants-alternate branch from 1620751 to 51e6b50 Compare August 9, 2023 13:34
Copy link
Member

@ghengeveld ghengeveld left a comment

Choose a reason for hiding this comment

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

LGTM and seems to work well.

@JonathanKolnik JonathanKolnik merged commit 479fae3 into main Aug 21, 2023
@JonathanKolnik JonathanKolnik deleted the 56-selecting-specific-element-also-applies-pseudostate-to-all-its-descendants-alternate branch August 21, 2023 12:31
@github-actions
Copy link

🚀 PR was released in v2.1.1 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants