Re: [csswg-drafts] [css-pseudo] `::before(<ident>)` / `::after(<ident>)`: A possible path forwards for multiple gencontent pseudos? (#13860)

My gut feeling is that this would tank performance linearly with the amount of identifiers you define.

If you define 3 of these "parametric pseudos" in order, you're basically forcing the engine to resolve 6 more styles per element, for all elements.

Of course, in most cases you can just throw those styles away since they're not going to be generated, but you still need to look at whether those would match and that gets fairly annoying. Plus you might want to keep them around for invalidation?

There are optimizations possible, maybe (you match all the "::before", "::before(foo)" etc rules together and then filter during the cascade or something), but still very weird and not free.

The other potential issue is that we probably wouldn't want `::before(foo)` rules to match generic `::before` rules, but given things like `*, *::before, *::after { box-sizing: border-box }` are so common, that probably means we want `::before(*)` or so as well...

-- 
GitHub Notification of comment by emilio
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13860#issuecomment-4406988329 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 8 May 2026 13:59:21 UTC