Re: [csswg-drafts] [css-pseudo] Add a ::contents pseudo-element

@inoas OK, I didn't read properly your previous comment. Now I think I understand the "break cascading" problem. In fact I would probably recommend against using `*::contents` or `*::text` after a descendant combinator to set inheritable properties. I would transform your example into

```css
section { color: red; }
/* red in section & sub-elems */
section * { color: blue; }
/* red in section, blue in section sub-elems */
section { color: green; }
/* green in section, still blue in all sub-elms */
section p { color: orange; }
/* green in section, still blue in all sub-elms but orange in p as sub-elem */
section::text, section * { color: yellow; }
/* yellow in section and sub-elems but orange in p as sub-elem */
section::text { color: purple; )
/* purple in section, yellow in sub-elems but orange in p as sub-elem */
```

But I don't really see this as a new problem against `::contents` and `::text`. If someone uses

```css
*::before { color: blue }
very#specific.selector { color: red }
```

then `very#specific.selector::before` will have blue color despite `very#specific.selector`'s specificity, but this doesn't stop `::before` and `::after` from being useful nor being used all over the place.

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

Received on Thursday, 8 March 2018 18:53:57 UTC