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

[ui-shared-deps/theme] implement auto-switching theme vars module #70274

Merged

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Jun 29, 2020

Originally submitted as a part of #66673, but extracted to simplify the original PR.

This implements the @kbn/ui-shared-deps/theme module which has three exports:

  • euiThemeVars will point to the v7 or v8 theme, either light or dark mode, based on the UI Setting value at page load
  • euiDarkVars & euiLightVars specific pointers to the light/dark theme vars from eui.

Imports for @elastic/eui/dist/eui_theme_light.json and @elastic/eui/dist/eui_theme_dark.json will be rewritten to access the exports of the new @kbn/ui-shared-deps/theme module.

To show the module in use I removed the getTheme() helper from the APM plugin and instead used the import directly in x-pack/plugins/apm/public/plugin.ts. It would be totally reasonable to refactor this further and just import the theme from the location where it's needed, rather than passing it to fetchLandingPageData(), but I wanted to avoid coupling the APM code further to this magic without them asking for it.

@spalger spalger added Team:Operations Team label for Operations Team v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.9.0 labels Jun 29, 2020
@spalger
Copy link
Contributor Author

spalger commented Jul 1, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@spalger spalger marked this pull request as ready for review July 1, 2020 05:44
@spalger spalger requested review from a team as code owners July 1, 2020 05:44
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Jul 1, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:apm)

Copy link
Member

@mistic mistic left a comment

Choose a reason for hiding this comment

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

LGTM

@spalger spalger merged commit 481dccd into elastic:master Jul 1, 2020
@spalger spalger deleted the implement/canonical_eui_theme_vars_module branch July 1, 2020 17:14
spalger added a commit to spalger/kibana that referenced this pull request Jul 1, 2020
…astic#70274)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
spalger added a commit that referenced this pull request Jul 1, 2020
…le (#70274) (#70485)

Co-authored-by: spalger <spalger@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:APM All issues that need APM UI Team support Team:Operations Team label for Operations Team v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants