Skip to content

Commit

Permalink
[regression] Handle deprecated KibanaThemeProvider uses to include Ki…
Browse files Browse the repository at this point in the history
…banaRenderContextProvider (#163103)

## Summary

Unfortunately, #161914 regressed #162365 in that many plugins and their
Emotion styles (including EUI emotion styles) are now missing a cache
and are being appended to to the end of the document `<head>` as opposed
to within `<meta name="emotion">`.

What appears to be happening is many plugins are using a parent
`<KibanaThemeProvider>` but **not** a parent
`<KibanaRootContextProvider>` (not sure if this work is TBD or in
progress). This means that a parent `<EuiProvider>`, (which determines
the cache insertion of child Emotion styled components) is missing,
which is causing several CSS specificity bugs, e.g. around datagrid.

As a somewhat-bandaid-y fix, I've bogarted EUI's nested provider context
to check if the theme provider has a parent `EuiProvider`, and if it
doesn't, to use `KibanaEuiProvider` instead of `KibanaThemeProvider`.
This should set up the caches and context if needed, or otherwise simply
use the original `KibanaThemeProvider` component.

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Clint Andrew Hall <[email protected]>
  • Loading branch information
3 people authored Aug 4, 2023
1 parent 2bd52fc commit f2b07fc
Show file tree
Hide file tree
Showing 8 changed files with 487 additions and 877 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f2b07fc

Please sign in to comment.