theme-ui icon indicating copy to clipboard operation
theme-ui copied to clipboard

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

Open CamilleHbp opened this issue 3 years ago • 1 comments

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?

CamilleHbp avatar May 19 '22 06:05 CamilleHbp

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 avatar May 19 '22 19:05 hasparus

:rocket: Issue was released in v0.15.2 :rocket:

hasparus avatar Oct 04 '22 15:10 hasparus

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

CamilleHbp avatar Nov 21 '22 18:11 CamilleHbp