-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte's usage of the :where
CSS selector breaks sites in Safari 12 and 13
#14518
Comments
There's a recent issue about this: #14420 |
The use of |
It says at the top that "Svelte 5 requires a modern browser (in other words, not Internet Explorer)". It really should be more specific than that. Safari 12 and 13 are not Internet Explorer. "In the event that you need to support ancient browsers that don’t implement :where".. what is "ancient"? Where is the cut off? Why isn't the list of supported browsers more clear? But yeah I guess that's exactly what #14420 is about. How and where can I use that mentioned workaround? Where am I supposed to add that line? The workaround in the docs isn't super helpful as-is. |
Ok, I think I found it. Edit
Maybe the docs can be improved with a fully working workaround? |
That only worked in development mode, not when creating a build. Then all the
Is this really the expected workaround? To have a custom plugin in |
Describe the bug
Svelte uses the
:where
CSS selector when you use a CSS selector likeli.main-menu:hover ul
. Svelte turns that into.main-menu.svelte-13eihuy:hover ul:where(.svelte-13eihuy)
.This
:where
selector has only been added to Safari in version 14.The fix is to change
li.main-menu:hover ul
intoli.main-menu:hover :global(ul)
, but this is not obvious and you won't notice that your CSS doesn't work in older browsers unless you specifically test your site in them.Now obviously I know that Safari 12 and 13 are quite old, but aren't they supported by Svelte? What is the list of supported browsers anyway?
Reproduction
I have an extremely simple version here in the playground:
https://svelte.dev/playground/ca3a0989871744e7b2d43959c9d6f574?version=5.4.0
When you inspect the generated css, you will see this:
This will not work in Safari 12 or 13.
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: