Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Personally I think this solution is simpler and easier to implement than using js. This isn't really an abuse. This seems exactly what these tags were intended for


view as:

It says it in the article:

> WARNING! This is a misuse of these HTML elements. While it is valid markup, it may not be accessible. This is an experiment and not intended for production use.


Then what is the correct use for them? If it's valid markup, used for the correct purpose, accessibility is the responsibility of the browser.

The correct use is for the <summary> element to be a summary of the rest of the block. This is not the case in threaded conversations.

Is the title of a thread not a summary of that thread?

This is not about the title but about a post and its replies though.

But in most "threaed forum" examples, including several in the article, such as HN or Reddit, the post contents would be in the body of the DETAILS and the SUMMARY for when minimized is just the title or a summary of how many comments are below. This article isn't suggesting putting the whole post in the SUMMARY, though the given example doesn't likely make that clear because it isn't a full example.

Seems an overly cautious warning. The spec seems to indicate that the only "semantic" meaning to these elements is "I have content or controls I wish to show/hide" and the accessibility guarantee is "allow the user to show/hide details". It sounds perfectly cromulent use.

Could even default the details to shown with the "open" attribute and still meet the spec-detailed description as the affordance there is that it can then be hidden.

DETAILS spec: https://html.spec.whatwg.org/multipage/interactive-elements....


Legal | privacy