storybook-addon-pseudo-states icon indicating copy to clipboard operation
storybook-addon-pseudo-states copied to clipboard

More sophisticated rule rewriting is needed

Open kylegach opened this issue 4 years ago • 1 comments

Exact error received:

withPseudoState.js:178 DOMException: Failed to execute 'insertRule' on 'CSSStyleSheet':
Failed to parse the rule '.MuiButtonGroup-root > :focus, .pseudo-focus .MuiButtonGroup-root >  { z-index: 2; }'

Input selector:

.MuiButtonGroup-root > :focus { ... }

Actual output selector:

.MuiButtonGroup-root > :focus, .pseudo-focus .MuiButtonGroup-root >  { ... }

Expected output selector (proposed):

.MuiButtonGroup-root > :focus, .pseudo-focus .MuiButtonGroup-root > * { ... }

Possibly related to #9.

kylegach avatar Jun 03 '21 21:06 kylegach

I thought I could work around it, by updating the input selector to:

.MuiButtonGroup-root > *:focus { ... }

Which I would imagine would work, but I can't confirm because the old selector is cached? I've tried clearing the Storybook cache and starting it with the --no-manager-cache flag, but no luck.

Is this addon doing something to cache the rewrites?

kylegach avatar Jun 03 '21 21:06 kylegach