W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: Thoughts on implementing the HTML5 <details> element with pure CSS

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 7 Apr 2010 07:54:06 -0700
Cc: Maciej Stachowiak <mjs@apple.com>, www-style CSS <www-style@w3.org>
Message-Id: <365CB055-29B8-44E0-A869-39B334209C46@gmail.com>
To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>

On Apr 7, 2010, at 4:07 AM, Daniel Glazman wrote:

> Le 07/04/10 08:13, Maciej Stachowiak a écrit :
> 
> 
>> 2) I need the <summary> child of <details> to remain visible both when
>> expanded and collapsed, but have all the other contents appear or
>> disappear, including direct text node children of the <details> element.
>> However, there is no way to address all of the children of <details>
>> except the <summary> child with a CSS selector.
> 
> details > *:not(summary) ?
> 
> That said, this will not address text nodes children of <details>. But
> IMHO, allowing text nodes here is a design mistake. DLs have DTs and
> DDs. <details> should only have element children.

But this element is not defined that way. So if a closed <details> still showed some of its children (even text nodes), then it would be an implementation mistake too (if this was part of the UA style sheet).

It would be better if there was an element surrounding just the part that was open. If HTML5 wasn't thoughtful enough to include one, maybe we could add it as a pseudo-element?

details::actual-details { display:none }
details[open]::actual-details { display:block; }


Received on Wednesday, 7 April 2010 14:54:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT