whatwg / whatwg.org

The WHATWG website and other static resources
https://whatwg.org/
Other
75 stars 50 forks source link

Definitions in headings are visually unrecognizable #425

Open not-my-profile opened 11 months ago

not-my-profile commented 11 months ago

For example the heading of section 13.2.6.5 of the HTML spec is rendered as:

image

what you cannot see is that "foreign content" is hyperlinked clickable.

annevk commented 11 months ago

That's a definition, but valid point.

I wonder if we should solve the styling issue or instead attempt to move definitions out of headings as generally that seems like bad practice to me.

domenic commented 11 months ago

I think definitions in headings is fine, and the fact that it's not obvious that they're definitions is also fine? The point of definitions is to have something to link to; they don't need to be visually obvious, IMO.

not-my-profile commented 11 months ago

The point is that html-dfn.js turns these definitions into interactive elements and interactive elements should be visually recognizable.

Moving these definitions out of the headings could be one possible way of addressing this, and could probably also address whatwg/html#9811.

domenic commented 11 months ago

Yes, there are a number of interactable elements in HTML which are not properly marked up. It'd be nice to add some stuff to our build tools to emulate what Bikeshed (the other major spec build tool) does to them, which is add a little floating # permalink indicator.

not-my-profile commented 11 months ago

I don't know what you mean by "little floating # permalink indicator.". The bikeshed whatwg specs use the same styling as the HTML spec.

annevk commented 11 months ago

They have different markup which sometimes helps (and sometimes does not), but for this they appear to have the same problem: https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-mime-type?

janbrasna commented 1 month ago

A quick PoC adding subtle 30% grey dotted underline:

body.dfnEnabled dfn { text-decoration: underline dotted var(--a-underline); }

Screen Shot 2024-07-22 at 18 34 51

doesn't make it too busy, but admittedly the dfns are a plenty, so it may seem like a noise somewhat.