kibana/packages/core/overlays
Cee Chen f2b07fc47d
[regression] Handle deprecated KibanaThemeProvider uses to include KibanaRenderContextProvider (#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 <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Clint Andrew Hall <clint@clintandrewhall.com>
2023-08-04 09:11:31 -07:00
..
core-overlays-browser fix console errors in inspector (#156894) 2023-05-15 09:02:27 -06:00
core-overlays-browser-internal [regression] Handle deprecated KibanaThemeProvider uses to include KibanaRenderContextProvider (#163103) 2023-08-04 09:11:31 -07:00
core-overlays-browser-mocks Flags core mocks packages as devOnly (#149466) 2023-01-26 08:46:06 -07:00