unyt-org / uix

The UIX Framework
https://uix.unyt.org
MIT License
62 stars 3 forks source link

Use nested selections for component-scoped styles #111

Closed benStre closed 6 months ago

benStre commented 7 months ago

Currently, component selectors are added to each css block in a scoped stylesheet. The current regex replace strategy leads to invalid results for nested selectors. If nested selectors are supported in all browsers, a root component selector could be wrapped around the whole stylesheet:

uix-x {
  div {
    ...
  }
...
}

Alternatively, the @scope selector might be used.

benStre commented 6 months ago

Example: Screenshot 2024-04-07 at 20 21 37