Re: [csswg-drafts] [css-pseudo] Add a ::contents pseudo-element (#2406)

> If the `::before` and `::after` pseudos can be created by adding a property internally, couldn't `display` be the generating property on `::contents`?

I like that idea. And then, the default style for it could be `::contents: { display: contents }`, with the condition that for this value the pseudo-element is not generated.

Although, there might be cases where someone could want to have such an element, but the only thing I can think of is something like “I want to pass some inherited property down to the children without actually applying it on the element itself”. This could be mostly worked around via `> *` and `inherit()` (but not completely), so I think it is ok to sacrifice this use case.

With `display` values besides `contents` creating the pseudo-element there won't be a `*::contents { }` value that people could shoot themselves in the foot, I don't think so?

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


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

Received on Monday, 10 June 2024 22:49:59 UTC