wix / stylable

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

feat: default to universal inferred context selector #2844

Closed idoros closed 1 year ago

idoros commented 1 year ago

This PR changes the inferred selector context under the new experimentalSelectorInference flag.

The default inferred selector context is used in 2 cases

Before this change the inferred selector used was the stylesheet root, and this PR changes it to be a universal selector (behind the flag), which means that custom-pseudo-element/class cannot be floating:

.root {
    -st-states: state;
}
.part {}

/* all of these cases will now report unknown pseudo diagnostics and will not transform */
:state {}
::part {}
.x :state {}
.x ::part {}