#1814 closed enhancement (fixed)
Style Code Reference ToC links to better indicate interaction
Reported by: | kevinwhoffman | Owned by: | kevinwhoffman |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Developer Hub | Keywords: | has-screenshots ui-feedback has-patch |
Cc: |
Description
The devhub ToC links have black text with no hover effect beyond the default browser cursor change. I'm suggesting that the links are styled similarly to the Codex ToC links which provide :link, :hover, and :visited styles. Screenshots attached.
Attachments (7)
Change History (19)
#2
@
8 years ago
- Keywords has-patch added
1814.diff adds hover styles to the ToC in the Code Reference and slightly tightens up the un-ordered lists.
We don't really use :visited
styles anywhere else on DevHub so for now I'd rather not add them in lieu of a design review. Hover styles now with possible :visited
styles later would be the best short term fix, imo. See 1814._after.png.
#5
@
8 years ago
@drewapicture Hover styles look good. What about using blue for the default :link state? There's still no visual indication that those are clickable links until hovering, which you can't do on touch devices.
#6
@
8 years ago
@kevinwhoffman I think the purpose of a table of contents on DevHub just as with handbooks is fairly self-explanatory - it's a list of jump links.
Whether the links are initially blue or black is not really the problem, in my opinion. For that matter, we're using slightly modified -- but basically the same -- styles as the handbooks and to my knowledge there have never been complaints about not realizing they were links.
Also for what it's worth, when I clicked them on an android device, the hover styles were triggered.
#7
@
8 years ago
@drewapicture Forgive me for getting a little nitpicky with my designer hat on.
Affordance is a web design principle in which characteristics imply an action. In other words, elements that are clickable should look clickable, regardless of whether you can deduce their purpose based on their surroundings (such as within a ToC). For hyperlinks, that usually means styling them differently through font-color, font-style, or underlining them and adding a hover style to further imply interaction.
Most mobile devices will flash the hover style when tapped, but that's not the point. The user has already initiated the action. Affordance is about suggesting action before the action itself takes place. And right now, there is still nothing outside of their presence within a ToC that indicates these are links because they look exactly like the content text.
I get what you're saying that a reasonable person can figure out they are links. I'm less concerned about this specific ToC scenario than I am about how this is being handled throughout the rest of Devhub, especially when it seems like a step backwards compared to the UI of the Codex.
I was asking in Slack if a style guide is available to guide these decisions. If you know of one or are interested in starting one, let me know.
This ticket was mentioned in Slack in #meta-devhub by drew. View the logs.
8 years ago
#9
@
8 years ago
- Owner changed from DrewAPicture to kevinwhoffman
- Status changed from accepted to assigned
@kevinwhoffman Would you like to pick up this ticket and perhaps work further with @hugobaeta to come to some consensus on how TOCs should generally fit into the design make-up of .org? Many of the DevHub TOC styles are inherited from the standard handbook styles.
See also #1825 where handbooks are being styled inline with O2.
#10
@
8 years ago
In the context of the handbooks it's more obvious (to me) that the TOC items are linked chapters in a book. The items are also made up of sentences instead of just words like 'Parameters' or 'Source'. By displaying the ToC items from the code reference as links you get an instant clue what the highlighted section might do (when looking at it at a glance).
The ToC items are the same for all parsed post types and only link to sections within the page itself. This makes the title "Table of Contents" seem a bit off. We could rename it to "Contents" like in the screenshots of @kevinwhoffman or leave it off completely.
Devhub ToC styles