chromaui / storybook-addon-pseudo-states

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

Avoid invalid `::part` selector #113

Closed m-akinc closed 5 months ago

m-akinc commented 5 months ago

It is not valid CSS to add a class selector to the ::part() pseudo-element, so rewriting a selector like ::part(foo):hover to ::part(foo).pseudo-hover is a problem.

::-webkit-scrollbar-thumb and ::-webkit-slider-thumb have the same limitation, and there was already logic to avoid generating modified selectors that included those. However, that logic was overly restrictive, preventing valid rewrites like div:hover::-webkit-scrollbar-thumb -> div.pseudo-hover::webkit-scrollbar-thumb.

This change includes:

m-akinc commented 5 months ago

@ghengeveld Assuming this gets merged, I have at least one other change to submit afterwards.

ghengeveld commented 5 months ago

@ghengeveld Assuming this gets merged, I have at least one other change to submit afterwards.

Do you want to release that other change along with this one? In that case this PR should be labeled with skip-release.

m-akinc commented 5 months ago

Do you want to release that other change along with this one? In that case this PR should be labeled with skip-release.

I assumed it would be easier to just release once, which is why I gave that heads-up. I don't have permissions to modify the labels on the PR, so I guess you will need to add the label (unless you want to give contributors that permission).

github-actions[bot] commented 4 months ago

:rocket: PR was released in v3.1.0 :rocket: