eui
eui copied to clipboard
[EuiProvider] Provide data about parent and default theme configurations
Related: https://github.com/elastic/kibana/issues/140122
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.