You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add ThemeProvider to the published code, rather than limiting it to src-doc. Switching themes seems to be a very common scenario, and I suspect its implementation is fairly consistent -- a context consumer that would allow light/dark toggling, and a provider that should use the provided EUI styles with optionally adding a few app-specific ones.
Note that there is a bug -- the NPM package's @elastic/eui/eui.d.ts already includes ThemeProvider and many other src-doc files, thus IDEs suggest to add import { ThemeProvider } from '@elastic/eui'; which later does not work. See #3849
The text was updated successfully, but these errors were encountered:
This was covered in some internal discussion, but posting here for visibility. Currently theme management is the responsibility of the application, not EUI. This will likely change as we move towards CSS-in-JS solutions, and we'd rather keep the discussion on those issues. Here is a good summary of some recent work around the subject. #3760 (comment)
Gonna close this one, but leave the linked issue (which is a bug) up.
Please add ThemeProvider to the published code, rather than limiting it to
src-doc
. Switching themes seems to be a very common scenario, and I suspect its implementation is fairly consistent -- a context consumer that would allow light/dark toggling, and a provider that should use the provided EUI styles with optionally adding a few app-specific ones.Note that there is a bug -- the NPM package's
@elastic/eui/eui.d.ts
already includesThemeProvider
and many othersrc-doc
files, thus IDEs suggest to addimport { ThemeProvider } from '@elastic/eui';
which later does not work. See #3849The text was updated successfully, but these errors were encountered: