Closes#6969
As discussed there, container query support is quite useful to add to Svelte as it is now broadly available with Firefox releasing support imminently w/ FF v110 this upcoming week (~Feb 14th). Chrome has had support since ~Aug '22. The central issue is that css-tree which is a dependency for CSS AST parsing is significantly lagging behind on adding more recent features such as container query support. Ample time has been given to the maintainer to update css-tree and I do have every confidence that in time css-tree will receive a new major version with all sorts of modern CSS syntax supported including container queries. This PR provides an interim solution for what Svelte needs to support container queries now.
Fixes#7152, see also #7288
--foo:; used to be an invalid CSS custom property value, while -foo: ; was valid. By collapsing the whitespace in these declaration values, we were breaking scenarios where an empty custom property was desired. The spec was updated to trim whitespace and treat these values identically, but Chromium browsers still treat --foo; as invalid. This was recently fixed and will be released in Chrome 99, but this would still be a good fix to maintain backwards compatibility.
* Allow to customize the css scope class
* Pass component name to scope class generator
* Move Stylesheet arguments into an object
* Refactor to cssHash
* Please the almighty linter
* pass hash function to cssHash
* update test
* document cssHash option
Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
- the change in #1705 introduced a small bug for users who were relying on assigning global CSS variables via the :root selector
- this change adds a small exemption to avoid prefixing :root with the random prefix that svelte adds