Remove Sass @euiToolTip mixin usages#194652
Conversation
- normally we don't recommend reaching directly into components for styles, but this is the easiest migration path forward currently
- Emotion styles come with font size/line height set, this unsets it to previous render
- normally we don't recommend reaching directly into components for styles, but this is the easiest migration path forward currently
- normally we don't recommend reaching directly into components for styles, but this is the easiest migration path forward currently
…ith EUI Sass variables
e90ba3d to
fdc2a17
Compare
| @@ -1,15 +1,12 @@ | |||
| .detailedTooltip { | |||
| pointer-events: none; | |||
| @include euiToolTipStyle('s'); | |||
| } | ||
|
|
||
| .tooltipAnnotation { | ||
| @include euiToolTipStyle($size: 's'); |
| @@ -1,19 +1,18 @@ | |||
| .mlChartTooltip { | |||
| @include euiToolTipStyle('s'); | |||
There was a problem hiding this comment.
In the screenshot above the tooltip is now hiding the red marker on the chart.
|
Pinging @elastic/eui-team (EUI) |
| @@ -1,12 +1,15 @@ | |||
| .visTooltip, | |||
| .visTooltip__sizingClone { | |||
| @include euiToolTipStyle('s'); | |||
There was a problem hiding this comment.
@elastic/kibana-visualizations I'm not sure where this tooltip is being used or how to reproduce it/see it in the browser - I'm fairly sure this change should work without major issue, but please let me know if not.
There was a problem hiding this comment.
Hi @cee-chen you can test it by turning on the visualization:visualize:legacyHeatmapChartsLibrary advanced setting and creating an Agg Based heatmap.
I've tested locally and I believe we need to bring all the properties there, because the color you have assigned are different then before.
Before:

After:

There was a problem hiding this comment.
Unfortunately the code there is not React so you can't use the hooks for EUI.
Probably just copying the shadow/border/background/color is enough
There was a problem hiding this comment.
Ah I hadn't realized the difference was that stark, I'll copy the shadeOrTint Sass exactly in that case. It's still fairly fragile however as a warning - If EuiToolTip's styles ever change in the future (there is talks of a new theme on the horizon) then you'll need to manually update your custom tooltip to match.
There was a problem hiding this comment.
I know, but just consider that these tooltip and visualization editor will be remove in the future, so don't worry about that too much.
So please go on with and copy the EUI tooltip styles for now, thanks
There was a problem hiding this comment.
@cee-chen I'm just waiting for this to approve, whenever you have it ready please ping me
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
| import TooltipTrigger from 'react-popper-tooltip'; | ||
| import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; | ||
| import { EuiFlexGroup, EuiFlexItem, useEuiMemoizedStyles } from '@elastic/eui'; | ||
| // @ts-ignore Kibana does not have types for eui/lib |
There was a problem hiding this comment.
| // @ts-ignore Kibana does not have types for eui/lib | |
| // @ts-expect-error Kibana does not have types for eui/lib |
@ts-expect-error would probably be better here as it'll catch when these types are fixed.
|
Hey y'all! Super apologies for dropping the ball on this PR for a bit. I ended up realizing that EUI unfortunately can't deprecate the |














Summary
This PR is part of EUI's ongoing Emotion migration, and removes EuiToolTip Sass mixins that will shortly be removed/deprecated from EUI.
3 usages of tooltip style mixins have been replaced with its migrated Emotion/CSS-in-JS equivalent. This is a somewhat stopgap measure - if possible, we'd prefer consumers not reach directly into our internal/styles and use the baseline
<EuiToolTip>component instead. That being said, I've QA'd (almost) all instances and have confirmed that the affected tooltips still look the same as before (see below inline comment threads for before/after screenshots).Checklist