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
Describe the bug
In Gatsby site using gatsby-plugin-theme-ui, components don't receive the theme but appear to receive an empty object.
To Reproduce
Steps to reproduce the behavior:
gatsby new site
Install theme-ui and gatsby-plugin-theme-ui
cd site && yarn add theme-ui gatsby-plugin-theme-ui
add gatsby-plugin-theme-ui to plugins array in gatsby-config
add src/gatsby-plugin-theme-ui/index.js and add a variant with some basic styling
In src/pages/index.js include a Box component from Theme UI and set it's variant prop
Observe that variant prop has no effect
Scratch head
Expected behavior
Components should be styleable via variant and other props
Additional context
I'm not sure what I'm doing wrong. I've happily used Theme UI in other projects with success.
Inspecting with React Dev Tools shows that the top level ThemeProvider does in fact have my theme. Using useThemeUI in any component successfully returns an object that contains my theme. But, no variant or Styled System props have an effect. The sx prop adds styles to Theme UI components, but is not theme-aware unless I include the jsx pragma.
Describe the bug
In Gatsby site using
gatsby-plugin-theme-ui
, components don't receive the theme but appear to receive an empty object.To Reproduce
Steps to reproduce the behavior:
gatsby new site
cd site && yarn add theme-ui gatsby-plugin-theme-ui
gatsby-plugin-theme-ui
to plugins array in gatsby-configsrc/gatsby-plugin-theme-ui/index.js
and add a variant with some basic stylingsrc/pages/index.js
include aBox
component from Theme UI and set it's variant propExpected behavior
Components should be styleable via
variant
and other propsAdditional context
I'm not sure what I'm doing wrong. I've happily used Theme UI in other projects with success.
Inspecting with React Dev Tools shows that the top level ThemeProvider does in fact have my theme. Using
useThemeUI
in any component successfully returns an object that contains my theme. But, no variant or Styled System props have an effect. Thesx
prop adds styles to Theme UI components, but is not theme-aware unless I include the jsx pragma.Doing something like this…
…logs an empty theme object.
The text was updated successfully, but these errors were encountered: