You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that the type selector must be prepended to avoid creating an invalid compound selector, but Lightning CSS appends it instead. Other similar problem cases to .foo are #foo, :foo, and even foo.
I recently fixed a similar issue in esbuild and Lightning CSS has the same bug, so I figured I'd report it here too. FWIW my fix was a hack: I just moved the & token after the type selector when converting the nested selector to a token stream so that the later substitution of & ends up in the right place (so &a is basically changed to a& internally). I didn't do any big changes to token substitution itself such as re-parsing the token stream.
The text was updated successfully, but these errors were encountered:
Input:
Output from Lightning CSS (playground link):
Expected output:
The problem is that the type selector must be prepended to avoid creating an invalid compound selector, but Lightning CSS appends it instead. Other similar problem cases to
.foo
are#foo
,:foo
, and evenfoo
.I recently fixed a similar issue in esbuild and Lightning CSS has the same bug, so I figured I'd report it here too. FWIW my fix was a hack: I just moved the
&
token after the type selector when converting the nested selector to a token stream so that the later substitution of&
ends up in the right place (so&a
is basically changed toa&
internally). I didn't do any big changes to token substitution itself such as re-parsing the token stream.The text was updated successfully, but these errors were encountered: