chromaui / storybook-addon-pseudo-states

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

Dynamically updated stylesheets may not have pseudo states applied #86

Closed ghengeveld closed 11 months ago

ghengeveld commented 1 year ago

The addon currently processes every stylesheet in the document only once. It marks the stylesheet as "rewritten" and will never touch it again. However, sometimes a stylesheet might get updated dynamically, e.g. as a result of switching a theme global. In such cases any newly injected CSS rules will not get rewritten for pseudo states, because their parent stylesheet has been rewritten before.

Likely the solution would be to mark individual CSS rules as having been rewritten, rather than the stylesheet as a whole.

Flirre commented 11 months ago

@ghengeveld My team is (probably) experiencing this bug right now. Any reason why #87 isn't merged and released?

ghengeveld commented 11 months ago

87 is a potential performance regression. It needs more testing to verify it performs well.

Flirre commented 11 months ago

Hopefully it's not rude to ask, but is there a timeline or estimation for when this would be done?

ghengeveld commented 11 months ago

Working on it today. Ran into a snag though, so this might need a little more work.

ghengeveld commented 11 months ago

Shipped in v2.1.2