Re: [csswg-drafts] Ability to style <details>/<summary> to be open (e.g. for print styles)

+1 to any strategy that makes it possible to describe the behavior of `<details>`/`<summary>`  in standard CSS.  It would make it much more useful in responsive design (e.g., for a collapsible menu) if you could auto-expand (and hide the toggle `<summary>` button) when there is room for the full content.

Another way to approach this would be to have a generic selector for anonymous text nodes.  

So the default style rule for `<details>`/`<summary>`  would look something like:

```css 
details:not([open]) > *:not(summary),
details:not([open]) > *text* {
  /* any direct child elements other than summary, or any direct child text nodes */
  display: none;
}
```

There are other cases where it could be useful for authors to override default HTML renderings for anonymous text nodes, like `<meter>`/`<progress>`, where the anonymous text content inside is a formatted representation of the value, but is currently never rendered in supporting browsers.

A `*text*` selector could also simplify other browser styles, e.g. the way MS Edge adds a solid-color background to all anonymous text spans in high-contrast mode.

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

Received on Tuesday, 12 December 2017 20:33:00 UTC