-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling
Description
Describe the bug
I was trying to do the following:
.anim-checkbox:global([data-state='checked']) {
background-color: red;
}
But received an error: :global(...) not at the start of a selector sequence should not contain type or universal selectors(css-invalid-global-selector-position)
Digging into Svelte's issues, I found that this check comes from issue #6272. I fear the fix implemented is too restrictive, as I think my syntax would be perfectly valid.
For now, I have this work-around:
.anim-checkbox:global(.anim-checkbox[data-state='checked']) {
background-color: red;
}
Reproduction
Write the following into any style
tag in a .svelte
file:
.a:global([data-state]) {
/* ... */
}
Logs
No response
System Info
System:
OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400F @ 2.60GHz
Memory: 12.15 GB / 15.57 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 20.4.0 - ~/.nvm/versions/node/v20.4.0/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v20.4.0/bin/yarn
npm: 9.7.2 - ~/.nvm/versions/node/v20.4.0/bin/npm
pnpm: 8.6.7 - ~/.nvm/versions/node/v20.4.0/bin/pnpm
npmPackages:
svelte: ^4.2.0 => 4.2.0
Severity
annoyance
GauBen
Metadata
Metadata
Assignees
Labels
cssStuff related to Svelte's built-in CSS handlingStuff related to Svelte's built-in CSS handling