rustdoc: use browser-native tooltips for code and notable hover#111856
rustdoc: use browser-native tooltips for code and notable hover#111856notriddle wants to merge 1 commit intorust-lang:masterfrom
Conversation
This is the simplest way to adopt the timing guidelines described in <https://www.nngroup.com/articles/timing-exposing-content/>. It replaces the mouseover interactions used for "tooltip" popovers with HTML `title` attributes, which already do the right thing. The JavaScript-based popover code remains for click interaction, so that these elements remain accessible on touch screens, and because it's not possible to put links in native tooltips.
|
(rustbot has picked a reviewer for you, use r? to override) |
|
Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha |
|
I'm not sure having two "views" for the same tooltip is a good idea. Also, what's the size difference in the std? What do you think about this @rust-lang/rustdoc ? |
|
I find it rather useful that the tooltip content is clickable. I would rather have us implement the timing requirements. |
|
How about, instead, getting rid of the |
|
I find the hover to be quite useful as a hover. I'm not strongly opposed but I would prefer to retain the hover. |
|
@Manishearth Is something like #111892 more what you want? |
|
Looking at the preview, yeah, that looks better. From the guidelines we may want to introduce some instant non-popup hover interaction to the ℹ️, similar to what we have going on with the panic interface, so that people know that an interaction has "registered". Perhaps give it a more muted color that becomes darker, or just make the existing color darker, or give it a shadow, or something. |
|
FWIW I was searching around for some resources on tooltips and found this page which advises against using "title" to make tooltips. A nice vindication of the conclusion already reached in this PR: |
This is the simplest way to adopt the timing guidelines described in https://www.nngroup.com/articles/timing-exposing-content/. It replaces the mouseover interactions used for "tooltip" popovers with HTML
titleattributes, which already do the right thing.The JavaScript-based popover code remains for click interaction, so that these elements remain accessible on touch screens, and because it's not possible to put links in native tooltips.
Preview
On-hover tooltip for notable traits
On-click popup tip for notable traits (unchanged)