thysultan / stylis

light – weight css preprocessor
https://stylis.js.org
MIT License
1.71k stars 82 forks source link

Better leave `&` as original code when there's no CSS Selector #326

Open nitipit opened 6 months ago

nitipit commented 6 months ago

Issue

When using & and there's no CSS Selector, the & has been removed in the compiled code. Since nesting CSS & becomes official in early 2023, It would be better not to remove it.

Input

&.red { background-color: red }

Compiled to

.red { background-color: red }

Expect

Input

&.red { background-color: red }

Compiled to

&.red { background-color: red }