Skip to content

Commit 63b1dcc

Browse files
committed
document breaking change
1 parent e8b9b11 commit 63b1dcc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ Previously, a compound selector starting with a global modifier which has univer
8282

8383
Previously Svelte would always insert the CSS hash last. This is no longer guaranteed in Svelte 5. This is only breaking if you [have very weird css selectors](https://stackoverflow.com/questions/15670631/does-the-order-of-classes-listed-on-an-item-affect-the-css).
8484

85+
### Scoped CSS uses :where(...)
86+
87+
To avoid issues caused by unpredictable specificity changes, scoped CSS selectors now use `:where(.svelte-xyz123)` selector modifiers alongside `.svelte-xyz123` (where `xyz123` is, as previously, a hash of the `<style>` contents). You can read more detail [here](https://github.com/sveltejs/svelte/pull/10443).
88+
89+
In the event that you need to support ancient browsers that don't implement `:where`, you can manually alter the emitted CSS, at the cost of unpredictable specificity changes:
90+
91+
```js
92+
css = css.replace(/:where\((.+?)\)/, '$1');
93+
```
94+
8595
### Renames of various error/warning codes
8696

8797
Various error and warning codes have been renamed slightly.

0 commit comments

Comments
 (0)