eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiProvider] Provide data about parent and default theme configurations

Open thompsongl opened this issue 3 years ago • 0 comments

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.

thompsongl avatar Sep 06 '22 17:09 thompsongl