Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Emotion] Add Emotion theming support #6913
[Emotion] Add Emotion theming support #6913
Changes from all commits
e287afe
ac4dfca
64b1226
c8b6787
0107f93
e27ee4c
ca6a49d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also pretty 50/50 on providing the entire theme context (i.e.
colorMode
andmodify
alongside with theeuiTheme
vars) or justeuiTheme
itself, i.e.To be honest, I would assume most consumers won't need color mode info, but I think it might be syntactically confusing to return a
theme
prop that doesn't match the return structure of our ownuseEuiTheme()
hook. 🤷There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd plus one on having the return structure match our
useEuiTheme()
hook. It might be verbose, but I'm a big fan of consistency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really 50/50 on baking this into
EuiThemeProvider
by default.The other option would be to simply export
<EuiEmotionThemeProvider>
and allow consumers to opt into it, e.g.The major downside to that is that consumers will need to remember to re-include
EuiEmotionThemeProvider
every time they nestEuiThemeProvider
for component-level theming, i.e.The flip side is that baking in Emotion's theme context into
EuiThemeProvider
would be more inflexible for consumers who don't want our theme or want to use/set their own Emotion theme. Do we want to support those consumers though? see #5351There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By baking in the entire thing, do we provide enough of an escape hatch for folks with the
modify
object? In my mind, EUI powers Kibana as its first order of business, so we should be tailoring our approach to that first and allow folks to mod if that's what they need to do.To me it's like CRA. There's a clear set of defaults, but if folks absolutely need to mod things, they can
eject
and tailor the experience. The analogy isn't 1:1, but I look at it similarly in DX terms.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I think it's enough of an escape hatch. The other option we can consider is adding an
includeEmotionTheme
prop, e.g.I think with both of those options, we should have enough of an escape hatch for consumers who want to set their own Emotion theme/styling and not use EUI's.
edit: Ah, I just saw your comment down below where you don't think that prop is necessary. 🤔 I'd be good not including it for and waiting to see what feedback we get from consumers first!