Related: https://github.com/elastic/kibana-team/issues/805
EuiProvider ships with a default theme value for convenience, but the implicit fallback can cause problems when a component renders outside of the context tree. Missing a themeMode toggle is the most common, resulting in light/dark inconsistencies.
Similarly, inverting the colorMode does not always indicate a desire for the entire subcomponent tree to inherit. For instance, a design decision for all popovers to be light mode regardless of context.
Both can be addressed by adding more data about top-level EuiProvider use and configuration. That data can then be used to enforce usage by warn logging or throwing exceptions.
Related: https://github.com/elastic/kibana-team/issues/805
EuiProviderships with a defaultthemevalue for convenience, but the implicit fallback can cause problems when a component renders outside of the context tree. Missing athemeModetoggle is the most common, resulting in light/dark inconsistencies.Similarly, inverting the
colorModedoes not always indicate a desire for the entire subcomponent tree to inherit. For instance, a design decision for all popovers to be light mode regardless of context.Both can be addressed by adding more data about top-level
EuiProvideruse and configuration. That data can then be used to enforce usage by warn logging or throwing exceptions.