Skip to content

[8.x] [Lens/SCSS] Migrate tooltip.scss file (#215702)#216862

Merged
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-215702
Apr 2, 2025
Merged

[8.x] [Lens/SCSS] Migrate tooltip.scss file (#215702)#216862
kibanamachine merged 1 commit intoelastic:8.xfrom
kibanamachine:backport/8.x/pr-215702

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.x:

Questions ?

Please refer to the Backport tool documentation

## Summary

Part of elastic#208908

Replaces `tooltip.scss` file to css-in-js .

## Considerations

We copied the styles found in the
[euiToolTipStyle](https://github.com/elastic/eui/blob/80dacb3dcc21120e28efdfcf267e5fdfee84b692/packages/eui/src/global_styling/mixins/_tool_tip.scss#L1)
mixing that the .scss file is using the right background and color
tokens .

<!--

We want to replace `euiToolTipStyle` mixin that we can find in the file
that we want to migrate:

https://github.com/elastic/kibana/blob/8d81ed4a5b6f540ce9847bdd0477f52d514031b3/src/platform/plugins/shared/chart_expressions/expression_xy/public/components/tooltip/tooltip.scss#L3

We decided to follow a similar approach to the one used here:

https://github.com/elastic/kibana/blob/12aa3fc6ca8124db8cf5e940baec121482fd1a4b/x-pack/platform/plugins/shared/ml/public/application/components/chart_tooltip/chart_tooltip_styles.ts#L12

That imports from:

https://github.com/elastic/eui/blob/f615b48410ce199e2069b11a84131423d52e7b0f/packages/eui/src/components/tool_tip/tool_tip.styles.ts#L47

However, the styles are not exactly the same as the ones found in the
mixing:

https://github.com/elastic/eui/blob/80dacb3dcc21120e28efdfcf267e5fdfee84b692/packages/eui/src/global_styling/mixins/_tool_tip.scss#L1

For this reason, we need to override some of the fields e.g. `position:
absolute` ➡️ `position: relative`.

As we can see in the comparison, the color looks different:

-->

### before
<img width="304" alt="Screenshot 2025-03-25 at 13 36 01"
src="https://github.com/user-attachments/assets/434ae0eb-0895-47a8-b959-624760f14492"
/>

### after

<!--

<img width="326" alt="Screenshot 2025-03-25 at 13 33 20"
src="https://github.com/user-attachments/assets/a172bd05-489d-4396-830a-72e4296328ab"
/>

-->

<img width="297" alt="Screenshot 2025-03-26 at 11 31 22"
src="https://github.com/user-attachments/assets/cd7727ff-764c-4bbe-b863-aa1ee01639bd"
/>

## Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
(cherry picked from commit 972da88)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Apr 2, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) April 2, 2025 14:55
@kibanamachine kibanamachine merged commit 0a7a62b into elastic:8.x Apr 2, 2025
11 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #34 / dashboard app - group 3 dashboard panel copy to "after all" hook for "it always appends new panels instead of overwriting"
  • [job] [logs] FTR Configs #34 / dashboard app - group 3 dashboard panel copy to copies a panel to an existing dashboard

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
expressionXY 228 215 -13

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
expressionXY 94.4KB 89.1KB -5.3KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionXY 39.1KB 39.1KB -17.0B

cc @mariairiartef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants