[whatwg] Styling <details>

Tab Atkins Jr. jackalmage at gmail.com
Tue Apr 5 18:36:20 PDT 2011


I like the idea of using display:list-item for the <summary>.  It has
some unfortunate weaknesses due to the way that display:list-item is
defined; in particular, you can't get an inline summary without losing
the disclosure marker, since there's no way to make an inline
list-item right now.  I expect this to be fixed on the CSS side in due
time, with the 'display' property split into some subproperties such
that ::marker generation is independent of the list item being inline
or block.

I also like the display:transparent idea for handling the wrapper
around the rest of the contents.  Swapping out bindings (the second
solution) feels hacky and bad.  Using a <details>-specific
pseudo-element (the third solution) doesn't actually solve the problem
- it's still a box surrounding the extra content, so it would suffer
from the same problem that was previous cited, where setting
display:table-cell on an element in the contents wouldn't work as
intended.  Its only good side is that you can style the pseudoelement
directly, which would make *some* use-cases salvageable.

~TJ


More information about the whatwg mailing list