chromaui / storybook-addon-pseudo-states

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

How do you get this to work? #33

Closed abrahym-sharfeldden closed 2 years ago

abrahym-sharfeldden commented 2 years ago

Hi, I followed the README.MD and it's set up but what do I code to toggle between the states?

ghengeveld commented 2 years ago

There's a toolbar icon you can use to toggle the states.

abrahym-sharfeldden commented 2 years ago

So you simply set the states with CSS and it automatically does the toggling?

ghengeveld commented 2 years ago

Yes, just install the addon and use the toolbar to select the state you want to see, or add parameters to your stories to give them an initial pseudo state. You can also wrap your story components in a div with e.g. pseudo-hover class on it. See https://github.com/chromaui/storybook-addon-pseudo-states/blob/main/stories/Button.stories.js

abrahym-sharfeldden commented 2 years ago

Oh okay well, I guess it just doesn't work for me. Thanks anyway. As I shared, I did read the readme already.