Skip to content

[CSS-in-JS] useEuiTheme & withEuiTheme refactor#4594

Merged
thompsongl merged 5 commits intoelastic:feature/css-in-jsfrom
thompsongl:css-in-js/hook-refactor
Mar 11, 2021
Merged

[CSS-in-JS] useEuiTheme & withEuiTheme refactor#4594
thompsongl merged 5 commits intoelastic:feature/css-in-jsfrom
thompsongl:css-in-js/hook-refactor

Conversation

@thompsongl
Copy link
Copy Markdown
Contributor

Summary

  • Transformed return type of useEuiTheme from an array ([ theme, colorMode, modifications ]) to an object of shape
    { euiTheme, colorMode, modifications }
  • Improved the types of withEuiTheme to clarify wrapped component props and HOC props, allowing for IDE autocomplete support for theme variables.

### Checklist

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_4594/

@thompsongl
Copy link
Copy Markdown
Contributor Author

jenkins test this

ERROR: Failed to set up Chromium r818858! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_4594/

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM! Thanks for making this change. I think it's also easier this way if they ever just need to grab the current color mode. Instead of everything.

I posted a commit that just updated the doc section wording a bit. Feel free to edit if I didn't use the right language.

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_4594/

@thompsongl thompsongl merged commit 0e82dac into elastic:feature/css-in-js Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants