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

[ML] Replace useIsDarkTheme() with EUI's colorMode. #205079

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

walterra
Copy link
Contributor

Summary

This PR replaces the useIsDarkTheme() hook with EUI's colorMode. Since this was the last hook in @kbn/ml-kibana-theme left this removes the whole package too.

Note that the hook subscribed to an observable and was able to update the theme in place. EUI's colorMode will only be updated after a page refresh. Since updating the Kibana advanced setting to enable dark mode requires a full page refresh too, I guess it's fair to remove this behavior in favor of this simplification.

In the long run we should aim for getting rid of these checks altogether and rely on dark-mode-aware EUI tokens.

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.

@walterra walterra added :ml release_note:skip Skip the PR/issue when compiling release notes v9.0.0 EUI Visual Refresh labels Dec 23, 2024
@walterra walterra self-assigned this Dec 23, 2024
@elasticmachine
Copy link
Contributor

elasticmachine commented Dec 23, 2024

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EUI Visual Refresh :ml release_note:skip Skip the PR/issue when compiling release notes v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants