Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[selectors‑5] Making :: a (pseudo‑)combinator #5472

Open
ExE-Boss opened this issue Aug 26, 2020 · 3 comments
Open

[selectors‑5] Making :: a (pseudo‑)combinator #5472

ExE-Boss opened this issue Aug 26, 2020 · 3 comments

Comments

@ExE-Boss
Copy link
Contributor

ExE-Boss commented Aug 26, 2020

Due to backwards compatibility issues, :: can’t be a proper combinator (see #2284 (comment)).

There’s however nothing preventing us from making :: a combinator‑like thing that would preserve the current semantics, while allowing for #2284 (comment) and #4565.


The goal is to support:

* :: *:is(before, after, marker) { … }
/* being roughly equivalent to: */
*::before, *::before::marker,
*::after, *::after::marker,
*::marker,

*::slotted(*)::before, *::slotted(*)::before::marker,
*::slotted(*)::after, *::slotted(*)::after::marker,
*::slotted(*)::marker,

*::part(*)::before, *::part(*)::before::marker,
*::part(*)::after, *::part(*)::after::marker,
*::part(*)::marker { … }

But for backwards compatibility:

*::*:is(before, after, marker) { … }
/* meaning: */
*::before, *::after, *::marker { … }

and

* ::*:is(before, after) { … }
/* meaning: */
* ::before, * ::after, * ::marker { … }

Related issues

ExE-Boss pushed a commit to EB-Forks/csswg-drafts that referenced this issue Aug 26, 2020
@emilio
Copy link
Collaborator

emilio commented Sep 2, 2020

*::*:is(before, after, marker) { … }

I don't think such a selector would make sense. :is(before, after, marker) is already a valid selector, and means a totally different thing.

@ExE-Boss
Copy link
Contributor Author

ExE-Boss commented Sep 2, 2020

It’s on the selector that’s after the :: bit.

@valtlai
Copy link
Contributor

valtlai commented Mar 19, 2021

What about adding new pseudo-elements? Like ::is(before, after, marker), ::where(before, after, marker) and maybe also ::not(before, after, marker).

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants