Skip to content
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

It's not obvious that @theme-ui/core doesn't apply styles.root. #2235

Closed
CamilleHbp opened this issue May 19, 2022 · 3 comments · Fixed by #2333
Closed

It's not obvious that @theme-ui/core doesn't apply styles.root. #2235

CamilleHbp opened this issue May 19, 2022 · 3 comments · Fixed by #2333
Labels
released This issue/pull request has been released.

Comments

@CamilleHbp
Copy link

CamilleHbp commented May 19, 2022

Describe the bug
The default 8px margin that Chrome puts on the element is present, even when styling root to have margin and padding set to 0.

To Reproduce
Steps to reproduce the behavior:

Have "@theme-ui/core": "^0.14.5" (not using the complete theme-ui package since the mdx package causes problems with Vite build).
Inspect body and find a margin: 8px applied by default to the element

Expected behavior
Expected the to have margin: 0 on the body.

Screenshots
image

Additional context
I'm using React v18 and Vite as a builder. I saw this issue, but it's marked as resolved. Has there been a regression?

@hasparus
Copy link
Member

hasparus commented May 19, 2022

Have "@theme-ui/core": "^0.14.5" (not using the complete theme-ui package since the mdx package causes problems with Vite build).

@theme-ui/core doesn't add any styles to the root. This is implemented "later" in theme-ui (actually @theme-ui/theme-provider). I'm not sure if this is explained in the docs TBH.

Take a look at RootStyles

@hasparus hasparus changed the title 8px margin on body from user agent stylesheet It's not obvious that @theme-ui/core doesn't apply styles.root. May 24, 2022
@lachlanjc lachlanjc linked a pull request Oct 1, 2022 that will close this issue
@hasparus
Copy link
Member

hasparus commented Oct 4, 2022

🚀 Issue was released in v0.15.2 🚀

@hasparus hasparus added the released This issue/pull request has been released. label Oct 4, 2022
@CamilleHbp
Copy link
Author

Thanks for the follow-up and the change to the documentation ! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants