cfpb / design-manual

⚠️ THIS REPO IS DEPRECATED ⚠️ A set of design principles and standards for the Consumer Financial Protection Bureau.
https://cfpb.github.io/design-manual/
Creative Commons Zero v1.0 Universal
98 stars 71 forks source link

Finalize tooltips style + functionality #139

Open mebates opened 10 years ago

mebates commented 10 years ago

Backlog item, for a future date post-release.

137

128

jenn-franklin commented 9 years ago

@caheberer @nataliafitzgerald @stephanieosan @mebates

Regarding tooltips, OaH is currently using black with white text on our loan comparison tool, which is on build here: http://build.consumerfinance.gov/owning-a-home/loan-comparison/ We took this pattern from HMDA:

screen shot 2015-05-12 at 4 37 08 pm

We explored using a light grey background but felt it didn't stand against the grey of our tool well enough.

screen shot 2015-05-12 at 4 33 39 pm

And a different color, such as green, is too similar to our green education notes, which we want to be visually differentiated.

screen shot 2015-05-12 at 4 35 08 pm

Thoughts re: whether our use of this is further solidifying black with white text as a design standard? Or should the design standard be further explored and our use of this style be considered a special case situation due to the visual needs of the tool?

jenn-franklin commented 9 years ago

Also--- perhaps with the black background we should take a look again at whether or not it should be transparent.

jenn-franklin commented 9 years ago

Update: our design on build is actually not currently transparent. Here are some screenshots for comparing.

OAH LC on build: screen shot 2015-05-12 at 5 08 59 pm

HMDA: screen shot 2015-05-12 at 5 12 39 pm

screen shot 2015-05-12 at 4 37 08 pm

mebates commented 9 years ago

I've always been against the black background, because I think a big block of reversed-out type is hard to read. There is lengthy discussion of this on our internal github, search "modals" and its the first to pop up (specifically, issue 78 in the digital-product-guide repo).

I also think we need to standardize the size and shape of the arrrow that comes off of the modal. I've always used our caret minicon as a starting point.

benguhin commented 9 years ago

I agree that the reversed-out type seems harder to read but it does help create clearer contrast between the tooltip and the rest of the page. Yet the heavy weight of the dark background doesn't seem to match with the rest of our styling.

Some questions in addition to style:

Adding the 508 tag for @JenniferHoran as we'll need to make sure that these are accessible for keyboard controls and screen readers.

stephanieosan commented 9 years ago

Okay, I'm splitting out tooltips and modals, because they're two separate elements and it seems like modals may have previously been finalized (at least in terms of styling). But as far as I can tell from the previous issue in the digital product guide, styling (and behavior) of tooltips requires a little more consideration.

Modals now live here: https://github.com/cfpb/design-manual/issues/325

stephanieosan commented 9 years ago

Recommendations for visual style:

Recommendations for behavior:


Visual styling decisions still to be made:

  1. Font size: 14 or 16? Most of our current implementations use 14, but 16 is more standard for us. All screenshots below use 14.
  2. Color of background and stroke: Should we favor readability within the tooltip (light background) or contrast against the rest of the page (dark background). See below ideas.

screen shot 2015-06-01 at 4 25 27 pm

A—10% grey with 50% grey stroke, black type B—Dark grey with white type (I know people have cited lack of readability, but tooltips are supposed to be very short pieces of content, so maybe this is worth it?) C—10% grey with 50% grey stroke, black type, flat black 25% opacity "shadow" to give the tooltips more visual separation and contrast from the page (I realize I'm opening up all kinds of blashemy here!)

Other questions

Another thing I've come across while pondering tooltips:

sonnakim commented 9 years ago

Recommendation: move to popovers instead of tooltips

(and add a close button for mobile users)

Currently, on desktop, the tooltip disappears when the user's mouse moves away from the tooltip icon. See www.consumerfinance.gov/hmda for an example. This is a persnickety interaction—the hit area for that tooltip icon is pretty small. I think we want to make this less frustrating for users, by transitioning to popovers.

With popovers, the information stays visible as long as the user's mouse is hovering over the popover. This makes it possible to include links. See below examples. Also, Bootstrap has some specifications for popovers here.

image

User can click links in the popover:

image


Recommendation: Add a close button to the upper right hand corner of the popover

I'd recommend adding a close button in the upper right-hand corner of the tooltip for mobile users. This seems the lowest lift approach to translating popovers to mobile.

So, if we are implementing the Bootstrap popover component, it should be modified with a close button.

jenn-franklin commented 9 years ago

I showed these during Graceland's session yesterday. Here are a handful of thoughts:

ascott1 commented 9 years ago

Can we add a solid triangle to the icon font? That will make implementing this much easier.

cc: @Dnpizarro

Thanks!

Scotchester commented 9 years ago

I could make an argument for implementing it other ways, but we could use solid triangles for other reasons, too, so might as well.

ascott1 commented 9 years ago

I'd be curious how else you'd implement that triangle (other than an image?). Maybe an inline SVG in the CSS?

Scotchester commented 9 years ago

Yeah, I was thinking maybe inline SVG with PNG fallback. The main question in my head was, "Considering this as a component standing alone, do we really want to add a cf-icons dependency just to get that shape in there?"

ascott1 commented 9 years ago

I think that's a good point. I'd argue for SVG data uri with no PNG fallback (do IE8 users really need that caret?).

Scotchester commented 9 years ago

Probably not :)

mistergone commented 9 years ago

Ah, are you guys not aware of the Magical CSS Triangle? :triangular_ruler:

The little triangle is actually really easy to implement, and it's mostly cross-browser compliant. Just Google "CSS Triangle." There's even a generator! Well, several, actually... here's one - cssarrowplease.com

I've done it with tooltips in Paying for College, and in some upcoming releases. It's a neat trick.

Scotchester commented 9 years ago

Can you pull off a rounded point with that?

mistergone commented 9 years ago

Hrm... well, essentially, you're making a zero pixel element with large borders, and all you see is the border, which would normally be trapezoidal, but instead ends up being a triangle because the top of the trapezoid is 0 pixels wide. Here's a fun experiment! If you use small triangles, like 5px wide, you can create the illusion of rounding by making the zero-pixel element into a 2px wide element!

Experiment 1, 5px arrow, 2px element

At larger sizes, the illusion still works okay (note: I am not currently on a retina display, so it might look crap on that):

Experiment 2, 15px arrow, 3px element

As it gets bigger, it feels to me like the illusion breaks down:

Experiment 3, 25px arrow, 3px element

I wonder if there's some trickery that could be done with border-radius, but uh... I'm not going to try that experiment right now.

DISCLAIMER: The pollen count is very high, my eyes are watering constantly, and thus my vision may be blurred... so maybe every angle looks rounded to me. Other, less allergic eyeballs may need to be consulted. :bouquet: :bee: :joy:

stephanieosan commented 9 years ago

That first one looks pretty round. I'm also hearing an undertone of "maybe we shouldn't have a rounded triangle because it's way fussier to implement."

Scotchester commented 9 years ago

It's a liiitle bit fussier, but not that much. Both techniques (SVG/image-based and Magic CSS Triangle) are fussy in different ways. Neither is rocket science. Whatever Design prefers is fine, IMO.

ascott1 commented 9 years ago

+1 to what @Scotchester said. It just comes down to considering the best way to implement it.

mebates commented 9 years ago

@stephanieosan and @huetingj any updated visual changes after the working session Jen mentioned 19 days ago? Can we close this out by Monday?

marteki commented 9 years ago

For awareness and completeness of examples, here's Claiming Social Security. We use tooltips in many places, including in paragraph copy.

Around labels, tooltips unactivated:

screen shot 2015-06-29 at 11 10 43 am

Around labels, tooltip activated:

screen shot 2015-06-29 at 11 11 05 am

In paragraph body copy, tooltips unactivated:

screen shot 2015-06-29 at 9 55 33 am

In paragraph copy, tooltip activated:

screen shot 2015-06-29 at 9 55 02 am

stephanieosan commented 9 years ago

Here are visual iterations based on above feedback:

screen shot 2015-06-29 at 11 17 43 am

designlanguage commented 9 years ago

In a couple of the instances @marteki posted, the blue color for the tooltip seems a little distracting. I understand that we use blue consistently to show something can be activated, but should we consider toning down the impact?

When used inline with text, it can disrupt the flow, as I think @benguhin mentioned in a working session. Would gray or a lighter blue solve that and still maintain accessibility?

screen shot 2015-06-29 at 11 27 54 am

This may be an edgecase, but when it's inline with radio buttons, it might seem at first glance like an additional option:

screen shot 2015-06-29 at 11 27 34 am

Scotchester commented 9 years ago

I agree with @designlanguage's concerns. Did the SSA team consider following the example of eRegs for indicating words for which definitions can be retrieved (a simple underline with a background color change on hover)?

@designlanguage On using a lighter blue: White is only accessible on full-on Pacific Blue. The question mark would have to change to black to use a lighter blue.

benguhin commented 9 years ago

@designlanguage I think for the inline usecase we may be better off underlining the term in a way that distinguishes it as a defined term but doesn't look like a standard hyperlink. This is sort-of what eRegs does for defined terms, though the interaction doesn't yield a tooltip:
screen shot 2015-06-29 at 12 27 28 pm

I think the underline is probably best for inline tooltips for two reasons:

  1. There's less visual noise with chunky circles breaking up text
  2. The tooltip is often referring to a term that involves multiple words, and an underline can make it clearer to the consumer which words are being defined/tooltipped

Overall, we should emphasize that it's best to use the paragraph text itself to explain what terms mean (and for form labels, we should use helper text that's shown by default to clarify things that aren't clear). There will often be edgecases and technicalities that are best communicated in a tooltip, but I think we want to avoid a future world in which we use confusing terms in the default view and assume that folks will read the tooltips when they get confused.

caheberer commented 9 years ago

I'm wondering how successfully users can determine the difference between a blue underline and gray underline (and their expected behavior).

I agree a plain language approach to the actual content is ideal.

mebates commented 9 years ago

Once we resolve the color issues, we are going to move to publish. @marteki, would you be willing to pull the in-line definition issue into a separate topic? We want to get this one sealed up for tooltips that aren't in-line.

marteki commented 9 years ago

Can do!

Dnpizarro commented 8 years ago

I know we deviated a little, but I just wanted to circle back. @huetingj and @stephanieosan has there been any updates for this issue?

marteki commented 8 years ago

We have a first pass at tooltips, for group review: http://caheberer.github.io/design-manual/ui-toolkit/tooltips.html

The examples given there are in image form, so not functional or even coded. We chose to incorporate recommendations for inline tooltips as well, as discussed in #335.

We've shopped this around to various design working sessions, but further feedback is greatly welcome at this point. What have we maybe missed, or what else should we maybe be thinking about?

Scotchester commented 8 years ago

I suggest removing the final section on "Icon labels". I'd prefer not to canonize this kind of usage. If it needs to be used, someone should have to make a strong case for an exception to do so.

Scotchester commented 8 years ago

Some thoughts on states:

Scotchester commented 8 years ago

In seeing the image of a tooltip over some text:

I submit that it would be nice if the design of the tooltip could set it off a little more from the page below it. It's not bad in the earlier examples, when it's just sitting on white, but when it's sitting on content, it feels a little messy to me.

marteki commented 8 years ago

Lots of good feedback from the Aqua Baobab working group on 9/2!

ielerol commented 8 years ago

Sorry, jumped over to the inline tooltips issue before I saw Marteki's comment that you're working on them both here. My comment: We do have an outstanding issue in eRegs to differentiate the underlines for definitions from the underlines for links. It wasn't a high enough priority to make it into the changes that will be rolled out in the next month, so we haven't done a lot of exploration, but the initial thought was to change the definition links to a dotted underline style. Which only works in this case because the eRegs unvisited hyperlinks are solid rather than dotted.

Although eRegs might not be the ideal model currently, I do think some kind of text-based visual distinction is less obtrusive than the minicon icons, when inline in text paragraphs. We've discussed also adding a faint background gray to the defined terms, lighter than the hover state gray.

ielerol commented 8 years ago

I have a monthly analytics report from eRegs as well, that doesn't really show any interactions with the definitions links, but I don't know right now if that's because no one's using them, or the current code doesn't track those interactions.

eRegs is also a highly specialized tool with an unusual user group, so I don't think I'd rely on data from it to make decisions about broader consumer-facing designs.

nataliafitzgerald commented 8 years ago

Visually, I prefer A and C that @huetingj posted a while back.

A) This one is nice and simple but does get a little lost amidst the other page elements. screen shot 2015-09-08 at 12 31 58 pm

C) I'm leaning towards a preference for this version. The "drop shadow" does help the tooltip to come off the page a bit. For the shadow, make sure to use a solid gray (no transparency) and offset it more to the right (imagine the light coming from the top left).

screen shot 2015-09-08 at 12 32 03 pm
caheberer commented 8 years ago

@Scotchester I was planning to follow our current standard for buttons for the icon hovers, but I noticed you mentioned on our tables issue that white on Pacific 80 isn't accessible. Do you know if our button standard will be changing?

Scotchester commented 8 years ago

@caheberer That's a great point... it probably should.

We didn't assign Buttons to anyone because I guess we figured it was pretty well covered already. (Is that right, @benguhin?) But perhaps we should reopen them and discuss.

Off the cuff, I'd suggest changing the hover state to the newly-proposed darker version of Pacific, as long as the active state (Navy) is different enough to be noticeable when hovering and then clicking. An alternative would be to make the darker Pacific the normal button state, and shift to regular Pacific on hover.

caheberer commented 8 years ago

Get your tooltips recommendation here! After incorporating feedback, our recommendation is ready for review by approvers! NOTE: this is a use case and style review, not a code review.

Please take a look at: http://caheberer.github.io/design-manual/ui-toolkit/tooltips.html

Approvers: @nataliafitzgerald @benguhin @Scotchester @JenniferHoran

Please post your comments by Wed. Sept. 16th. Thanks!

KimberlyMunoz commented 8 years ago

For the inline tooltips, would it make more sense to use something that we could base off of the <abbr> element. Hover links are difficult to make accessible, but <abbr> has that built in. We should be able to style the way the links look, but we might not always be able to style tooltip itself since it is browser/OS dependant.

image

benguhin commented 8 years ago

This is great. On the UI front y’alls are totally approved!

Some granular notes as you finalize all the details:

Scotchester commented 8 years ago

Style

States

44px radius around icon containing no other actionable items, to avoid target issues on touch devices

Any example of a tooltip next to a form field label will violate this rule. Maybe change the wording to say that this is preferred but not always practical?

New accessible Pacific 80 color (specify)

Should be something like "Dark Pacific", as it's darker than regular Pacific.

Navy 80% background color

Should be full Navy? Might depend on how much both colors contrast with Pacific and Dark Pacific.

2px Gray 50% bottom and right border

Probably clearer to call this "solid drop shadow" rather than border. The whole box already has a 1px border.

If container cannot be centered above icon because of proximity to either page margin, caret moves left or right accordingly. In this instance, the edge of the tooltip container should align to the right or left margin closest to the icon.

This sounds lovely, but difficult. I look forward to seeing how your Cat and Virginia handle it :)

Inline

Other than those items, all looks good!

caheberer commented 8 years ago

Transferring @nataliafitzgerald 's comments to this issue:

DM Styling edits:

caheberer commented 8 years ago

Thanks for the feedback, I’ve compiled a revision list that I’m working on to complete approval.

Other notes: @natalifitzgerald The alignment of images are all top-aligned, the image in “Activated” only appears lower because the tooltip is part of the image. (These are not coded.)

Max character count of 225 was chosen based on a sampling of explanations and definitions that currently exist and to not exceed 5 lines on large screens.

caheberer commented 8 years ago

@Scotchester @benguhin @nataliafitzgerald

Following the new palette, I'm proposing the attached for the tooltip icon states, which I also think we should use as our button standards. This change will make our buttons 508 compliant, because as @Scotchester mentioned, our current white on Pacific 80 isn't accessible. I've attached an image with the new hex/named values.

screen shot 2015-10-01 at 12 48 58 pm

JenniferHoran commented 8 years ago

This is great, thank you all!

marteki commented 8 years ago

Pinging @benguhin @nataliafitzgerald @Scotchester -

Can each of you give a :+1: or otherwise comment about changing the tooltip icon hover/focus/active state colors and matching our new color palette? It's our only thing left to figure out for this!