solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

[Bug?]: CSS nesting selector gets encoded on server side

Open draconisNoctis opened this issue 1 year ago • 1 comments

Duplicates

  • [X] I have searched the existing issues

Latest version

  • [X] I have tested the latest version

Current behavior 😯

When using the newly CSS nesting syntax (e.g. &:is(a)) the ampersand gets encoded as & on server side. This leads to missing/wrong styles until the client side javascript is executed.

Expected behavior 🤔

The server shouldn't encode the ampersand in the CSS styles.

Steps to reproduce 🕹

Use this repo for simple reproduction: https://github.com/draconisNoctis/solidstart-css-nesting-issue

Context 🔦

No response

Your environment 🌎

No response

draconisNoctis avatar Aug 08 '24 09:08 draconisNoctis

If I understand this right the CSS files themselves are being transformed nothing to do with JS. In which case is this a Vite or Nitro issue? Because Solid/SolidStart doesn't touch CSS. Very odd if Vite has an issue you'd think it would be more known.

ryansolid avatar Sep 25 '24 22:09 ryansolid

I am running into the same issue I think. I am using css modules, and the SSR'ed response has all the ampersands encoded

I originally also thought this could be a vite and/or postcss issue, but I was pointed out on the solid discord server that this is an issue in solid-start. It appenrantly is handled correctly by solid-meta.

chris-kruining avatar Dec 18 '24 13:12 chris-kruining