Skip to content

Conversation

@jordanoverbye
Copy link
Contributor

I needed to use the Global component from @emotion/core and I kept getting the following warning: It looks like you're using the css prop on Global, did you mean to use the styles prop instead?

So I was chatting with Mitchell Hamilton (core maintainer of emotion) about this issue and he suggested this was the best fix to get rid of that warning.

But this does not convert the styles in that component to theme values, which I think is expected.

But I guess this leads to the question, would you be interested in exposing a Global component that allows values to be passed to the sx prop?

@jxnblk
Copy link
Member

jxnblk commented Jul 14, 2019

Thanks! I'd been meaning to create an issue for this but kept forgetting... I think this fix looks great!

would you be interested in exposing a Global component that allows values to be passed to the sx prop?

I think generally we want to discourage the use of Global – we don't currently have a good built-in solution for reseting body margin, but other than that, it's really up to the end-user for how they handle global CSS. If someone did want to use the Global component with the theme, they can use the css function/utility

@jordanoverbye
Copy link
Contributor Author

@jxnblk yeah that's exactly what i needed to use the Global component for - styling the html/body :D

@jxnblk jxnblk merged commit 95d1aea into system-ui:master Jul 15, 2019
@jordanoverbye jordanoverbye deleted the update-getcss branch July 15, 2019 22:50
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.

2 participants