W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2017

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

From: Amelia Bellamy-Royds via GitHub <sysbot+gh@w3.org>
Date: Tue, 12 Dec 2017 20:32:55 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-351185353-1513110774-sysbot+gh@w3.org>
+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:

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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:21 UTC