wix / stylable

Stylable - CSS for components
https://stylable.io
MIT License
1.26k stars 62 forks source link

feat: added a way to force states on a single selector #2880

Closed barak007 closed 12 months ago

barak007 commented 1 year ago

Component libraries that uses this plugin and apis, used to copy it and change it to allow this functionality. they also made it worse by creating the context for each transformation.

now it's possible to share the context and transform only the selector ast

const context = createForceStatesContext(dataPrefix, namespaceMapping); // create once
mutateWithForceStates(parseCssSelector('.x:hover'), context); // use in the process