Skip to content
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

Selector Lists Break :global When Attributes Are Targeted (3.46.5) #7403

Closed
ITenthusiasm opened this issue Mar 30, 2022 · 1 comment
Closed

Comments

@ITenthusiasm
Copy link

Describe the bug

It seems that when #6435 got merged to resolve #6434, some loose ends still remained untied. In particular, there seem to be specific scenarios where :global(:where(selector-list)) and the like still do not work.

In my case, I cannot perform the following:

main :global([href], [href] + p) {
  color: red !important;
}

or anything similar.


From what I can tell so far, the issue seems to occur particularly when :global is the last part of a selector and it is passed a pseudo-class with a selector list that targets attributes.

Regarding the above example, you'll see that the selector is able to work properly when main > is removed or when [href] is changed to a non-attribute selector. But, of course, this means that a dev's set of options for styling their elements is noticeably restricted by this.

Reproduction

https://svelte.dev/repl/0d8c724d28b04840a9faaf36769047ec?version=3.46.5

Logs

No response

System Info

System:
    OS: macOS 12.2.1
    CPU: (8) x64 Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
    Memory: 56.29 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    npm: 8.4.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
    Watchman: 2022.02.14.00 - /usr/local/bin/watchman
  Browsers:
    Chrome: 99.0.4844.84
    Firefox: 98.0.2
    Safari: 15.3
  npmPackages:
    svelte: ^3.46.5 => 3.46.5


### Severity

blocking an upgrade
@dummdidumm
Copy link
Member

Fixed in Svelte 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants