Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips Style #193

Merged
merged 8 commits into from
Dec 7, 2017
Merged

Tooltips Style #193

merged 8 commits into from
Dec 7, 2017

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Dec 7, 2017

Initial re-work done

  • Re-worked Tooltip.js to conform to component style guide
  • Styling is all done except for positioning and transitions
  • TooltipTrigger.js still needs to be re-worked
  • Examples use EuiLink component to get styling for a trigger element.

- Re-worked Tooltip.js to conform to component style guide
– Styling is all done except for positioning and transitions
– TooltipTrigger.js still needs to be re-worked
@cchaos
Copy link
Contributor Author

cchaos commented Dec 7, 2017

@snide Please see if you can figure out how to position this thing against the trigger element via CSS only...

- Animations transform the tooltip but don’t position it
- Arrow now pointing in the correct direction
Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is sooooo much cleaner. Nice work. Had some minor styling comments. Feel free to adjust them how you think it would work best and merge away.


&.tooltip-container-visible {
// ANIMATING
transition:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a transition delay here. Just something so that the tooltip doesn't casually show if you're waving your mouse around a page. It's an easy way to make them not annoying and more directed.

&.tooltip-container-visible {
// ANIMATING
transition:
opacity $euiAnimSlightBounce $euiAnimSpeedSlow,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd up the speed to normal maybe? Then pair it with a shorter travel time. Feels less like it's flying over. Should be subtle.

transform $euiAnimSlightBounce $euiAnimSpeedSlow;
opacity: 0;
visibility: hidden;
transform: translateX(0) translateY($euiSizeL * -1) translateY(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think along with the quicker animation speed, if you cut the travel to something like $euiSizeS it might look a little tighter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll adjust all the timings here. I mainly just copied from the popover, but I suppose you're right about it being a different interaction from that and so needing a different animation.

.euiTooltip__content {

// Scoped variables for component-only re-use
$background-color: $euiColorDarkestShade;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I've avoided component variable tokenization, mostly because our theming system is so ridgid we kind of need people to use the globals. For example, if they changed this to a hex value, theming would break it dark mode.

If you think it's important prefix it with the component name $euiTooltipBackgroundColor...etc so you don't fun into conflicts since we generate a big sass file right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these variables are within the .euiTooltip__content{} they're not known to anything outside of this selector (and this particular section of the selector) so we won't run into any namespacing issues.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. 👍

// The tooltip title if it exists
.euiTooltip__title {
@include euiFontSizeM;
font-weight: $euiFontWeightLight;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blargh, this title is tough to read and it's totally my fault and I know you're copying what I had. Come up with something cooler! Should our small titles use bold? Probably? I dunno. Maybe adjust the color if we use the light / same size as the body? Maybe the body text just needs to be smaller and it would look fine?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I felt the same way. I can re-style.

- Animations just ease-out with a slight delay (unless it’s a click action)
- Title looks more like a title
- Adjusted the overall <strong> elements and added bold weight of 700
@cchaos cchaos changed the title In Progress: Tooltips Style Tooltips Style Dec 7, 2017
@cchaos cchaos merged commit bcbf471 into elastic:master Dec 7, 2017
@cchaos cchaos deleted the tooltips-style branch December 7, 2017 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants