Skip to content

Don't force <details> to be a block. #9830

@emilio

Description

@emilio

What is the issue with the HTML Standard?

https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements says:

The details element is expected to render as a block box.

This effectively ignores display set on the details element, so if you want to set display: flex, for example, you're out of luck.

This bites authors, even very experienced ones. The last one I'm aware of in bug 1856374.

There's no particular reason that this has to be the case. Probably it had to be the case before <details> was specified in terms of Shadow DOM, but now I'm not aware of any reason for this.

This was discussed in the CSSWG when @dbaron brought up https://github.com/dbaron/details-styling. He probably has a bunch more context on this stuff, but I think lifting this restriction should be uncontroversially better, if we can get away with it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions