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

The advantage of always generating it is that if you want to use it, it's easier. Compare:

 - With custom inheritance, you just need to use what you want:
    ```css
    #a::contents { color: blue }
    ```
    ```css
    #b::contents { display: block }
    ```
 - With `all: inherit` default, you may need `all: unset` if you generate a box:
    ```css
    #a::contents { color: blue }
    ```
    ```css
    #b::contents { all: unset; display: block }
    ```
 - With `enable-contents` property, you need an entirely different rule:
    ```css
    #a { enable-contents: yes }
    #a::contents { color: blue }
    ```
    ```css
    #b { enable-contents: yes }
    #b::contents { display: block }
    ```

Not a big fan of basing the existence on `display: contents` in a way that affects inheritance, since this isn't something that `contents` typically does, and we would lose the ability to just set inherited properties without generating a box.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2406#issuecomment-2159464536 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 23:16:54 UTC