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

[ILM] Remove euiThemeVars and remapping colors for Borealis #204449

Merged
merged 10 commits into from
Jan 8, 2025

Conversation

SoniaSanzV
Copy link
Contributor

@SoniaSanzV SoniaSanzV commented Dec 16, 2024

Part of #203664

Summary

This PR addresses the changes for Borealis theme that are related to the ILM plugin. That means get rid of euiThemeVars in Boreales in favor of useEuiTheme colors and remapping the colors for ILM status. It also eliminates the use of _behindText values in Borealis. This remapping is a mid-term solution since the Vis color palette is not been using here as this is not their intended use. In the future, probably a separate palette will be created.

Screenshot 2024-12-16 at 17 20 54 Screenshot 2024-12-16 at 17 20 40 Screenshot 2024-12-16 at 17 19 42 Screenshot 2024-12-16 at 17 19 58

@SoniaSanzV SoniaSanzV added Feature:ILM Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v9.0.0 labels Dec 16, 2024
@SoniaSanzV SoniaSanzV requested a review from mattkime December 16, 2024 16:56
@SoniaSanzV SoniaSanzV self-assigned this Dec 16, 2024
@SoniaSanzV SoniaSanzV requested a review from a team as a code owner December 16, 2024 16:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@SoniaSanzV SoniaSanzV mentioned this pull request Dec 16, 2024
8 tasks
@SoniaSanzV SoniaSanzV changed the title Remove euiThemeVars and remapping colors for Borealis [ILM] Remove euiThemeVars and remapping colors for Borealis Dec 16, 2024
@mattkime
Copy link
Contributor

Ran locally, looks good BUT I'd prefer to get some expert design code eyes on this so I'm withholding my approval for now.

Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

LGTM 💚 I compared the values against the table, they're correct. If we need to use different vis colors for Borealis, that is the correct way to do it 👍🏻

I'll refer to @mgadewoll just in case she has more thoughts on the changes.

@SoniaSanzV SoniaSanzV requested a review from mgadewoll January 3, 2025 09:20
Copy link
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

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

✅ Changes LGTM from EUI side.

&__inner--hot {
fill: $euiColorVis9_behindText;
&--borealis {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to implement these changes with emotion instead of adding to the scss. Here's an example of how I did this for upgrade assistant - https://github.com/elastic/kibana/pull/205345/files

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

Overall the changes are good but it would be better to implement them in emotion instead of scss.

@@ -5,11 +5,21 @@
* 2.0.
*/

/** @jsx jsx */
// Needed for for testing out the css prop feature. See: https://emotion.sh/docs/css-prop#jsx-pragma
Copy link
Contributor Author

@SoniaSanzV SoniaSanzV Jan 8, 2025

Choose a reason for hiding this comment

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

After adding emotion css, the affected snapshots displayed messages like this one:

<div
    -      class="ilmTimeline__colorBar ilmTimeline__frozenPhase__colorBar"
    +     class="ilmTimeline__colorBar"
    +     css="You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."
                            />

This was only happening in test, not in the final html. Following emotion docs and adding ** @jsx jsx * at the top of the file, fixed it

Copy link
Contributor

Choose a reason for hiding this comment

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

If you have to set the JSX pragma this could indicate that you might be missing a required Emotion babel preset for using the css prop for your plugin? 🤔 (emotion docs)

@SoniaSanzV SoniaSanzV requested a review from mattkime January 8, 2025 07:47
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
indexLifecycleManagement 160.6KB 160.5KB -93.0B

Page load bundle

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

id before after diff
indexLifecycleManagement 27.5KB 27.6KB +128.0B

History

cc @SoniaSanzV

const isBorealis = euiTheme.themeName === 'EUI_THEME_BOREALIS';

const phaseIconColors = {
hot: isBorealis ? euiTheme.colors.vis.euiColorVis6 : euiThemeVars.euiColorVis9_behindText,
Copy link
Contributor

Choose a reason for hiding this comment

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

ℹ️ We're introducing the behindText vis colors to the euiTheme (PR). This will land in Kibana with this weeks release.
As we want to remove the JSON token usages from client (react) code, it would be great if you could either update if the release is faster than this PR or do a follow-up to update 🙏

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

changes look good and work well, please make a follow up issue for https://github.com/elastic/kibana/pull/204449/files#r1907008672

@SoniaSanzV SoniaSanzV merged commit aa64895 into elastic:main Jan 8, 2025
8 checks passed
@SoniaSanzV SoniaSanzV deleted the use_eui_theme_ILM branch January 8, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting EUI Visual Refresh Feature:ILM release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants