Re: [csswg-drafts] Custom Pseudo Elements via New pseudo-before/pseudo-after Attribute (#11670)

> Introduce two new HTML attributes

Propose them to the WHATWG, then? But they would probably be rejected for being stylistic instead of semantic.

But I don't see why you want them to be HTML attributes instead of CSS properties.

> A pseudo element is created for each delimited string

That would trivially clash with standard pseudo-elements. Even with `<custom-ident>` restricted to non-existing pseudo-elements, it would still be a forwards-compatibility liability. The names should be restricted to dashed idents or something.

> The -before/-after suffix is to control where in the DOM they appear

There is still the question of their position relative to `::marker`, `::before`, `::after`, etc.

> Requiring HTML markup for this might help with engine optimizations

What optimizations do you have in mind?

> loops caused by :has()

Should be covered by https://github.com/w3c/csswg-drafts/issues/7463#issuecomment-1196971909

> Hyphen/underscore should be allowed in the pseudo element name for legibility reasons

Should be [`<custom-ident>`](https://drafts.csswg.org/css-values-4/#identifier-value) or [`<dashed-ident>`](https://drafts.csswg.org/css-values-4/#typedef-dashed-ident).


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


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

Received on Friday, 7 February 2025 15:29:17 UTC