Styles root, body vs. html
See original GitHub issueIs your feature request related to a problem? Please describe.
Theme UI root element is body
which, for most use cases works fine.
There are although some times when you really need to apply styles to to html
tag.
One of these uses cases is when dealing with rem
units (which are relative the root html
). So rem
units currently do not work with Theme UI.
It would be nice to have a way to target the html
tag somehow.
Describe the solution you’d like
Creating a version of <Global />
with Theme UI capabilities could be useful.
I’ll be working on something like that on one of my projects. We could potentially package it for the library.
I was thinking of a component inside the provider with an instance of Emotion <Global />
onto which we could inject a part of the Theme Context.
Additional context I’d love to know what you guys think about something like this and if you’ve experienced similar issues.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
@fcisio i think you can start here https://github.com/system-ui/theme-ui/blob/90b7c10b2c2533c0126c9e12787997c67778eb39/packages/color-modes/src/custom-properties.ts#L72
You will also need to update the theme typescript types and add some tests.
i will be happy to help out on your PR, i should be back home by Monday.
not sure what @hasparus had in mind with the comments?
Can we close this? @fcisio