svelte: :where breaks :global in 3.38.3

Describe the bug Using multiple selectors in :where (https://web.dev/css-is-and-where/) breaks :global in 3.38.3 and not 3.38.2.

Logs

:global(...) must contain a single selector (2:0)

To Reproduce In 3.38.2: https://svelte.dev/repl/564fb17fee1f491c89986252fb04776f?version=3.38.2 In 3.38.3: https://svelte.dev/repl/564fb17fee1f491c89986252fb04776f?version=3.38.3

Expected behavior Should have same behavior as 3.38.2

Severity Kind of high.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 17 (6 by maintainers)

Most upvoted comments

Unsubscribe

On Thu, Aug 25, 2022, 11:49 PM Alex Rodgers @.***> wrote:

I’m also still facing this issue using DaisyUI and svelte-markdown. Unfortunate as there doesn’t seem to be many markdown alternatives.

— Reply to this email directly, view it on GitHub https://github.com/sveltejs/svelte/issues/6434#issuecomment-1227610934, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARKKHVSBWGVFMP6U26FNMJ3V262JRANCNFSM47FZW2AA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Just looked through some DaisyUI issues. DaisyUI’s creator (Pouya) says:

“This issue must be fixed from Svelte. When we use <style global>, svelte tries to handle styles with :global() but it doesn’t process :where() correctly. table :where(th, td) is a valid CSS selector that I used in daisyUI but Svelte changes it to :global(.table) :global(:where(th), :global(td)) which is wrong.”

https://github.com/saadeghi/daisyui/issues/809#issuecomment-1136172021

I’m also still facing this issue using DaisyUI and svelte-markdown. Unfortunate as there doesn’t seem to be many markdown alternatives.

npm run build started failing after I added DaisyUI. After banging my head a while, I discovered this issue/thread and downgraded Svelte to 3.38.2, which caused npm run build to start working again.

Thank you for reporting this, @TheComputerM!

As far as I’m aware, this is not a bug: #6428

What should not work:

a > :global(b, c)

What should work:

a > :global(b), a > :global(c)
a > :global(:where(b, c))

Read about :where