chromaui / storybook-addon-pseudo-states

CSS pseudo-classes for Storybook
MIT License
88 stars 28 forks source link

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

Closed JonathanKolnik closed 1 year ago

JonathanKolnik commented 1 year ago
📦 Published PR as canary version: 2.1.1--canary.85.0bc3584.0
:sparkles: Test out this PR locally via: ```bash 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.

github-actions[bot] commented 1 year ago

:rocket: PR was released in v2.1.1 :rocket: