-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
compiler sometimes sometimes tries to encapsulate :global(...) #6550
Comments
https://svelte.dev/repl/9b67838a3ad04a52b3a21255f84051c2?version=3.40.2 Hm. In 3.40.2, correct-looking CSS is getting generated, but the scoping class is only getting added to the outer div in the DOM and not the inner one, so the text still isn't red. @tanhauhau Do you think there's anything that can reasonably be done about this? I don't think we want the compiler to be looking inside the |
This is the fix I was looking for! I just wanted get rid of that corruption at the beginning of the css output. I only put the outer div in the same component to make a simpler test case, I don't need that test case to work, I think the point of :global() is to span between different components. It seems like it would be tricky to decide if you want to make stuff inside :global() match stuff in the current component, and possibly tricky to implement. I suggest having that discussion/fix in a different issue (if it needs to happen at all) so it's easier to find/link/etc. |
my bad, didn't noticed that, fixing it in #6563 |
The rest of this should be fixed in 3.40.3 now - https://svelte.dev/repl/9b67838a3ad04a52b3a21255f84051c2?version=3.40.3 |
Describe the bug
There's a bug in how some css selectors are compiled, such that the class that the compiler adds (to scope things to the module) is prepended to the contents of
:global(...)
.Reproduction
compiles to:
This bug is about the extra
.svelte-lxuwwe
at the beginning that's smashed right up against the firstdiv
.Here's a repl showing this in action: https://svelte.dev/repl/9b67838a3ad04a52b3a21255f84051c2?version=3.38.3
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: