Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[regression] Handle deprecated KibanaThemeProvider uses to include Ki…
…banaRenderContextProvider (elastic#163103) ## Summary Unfortunately, elastic#161914 regressed elastic#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