question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ThemeProvider divergence between @theme-ui/core and theme-ui

See original GitHub issue

Describe the bug Implementation of ThemeProvider is inconsistent depending on what package you pull it from. theme-ui looks to be re-exporting it from @theme-ui/theme-provider, while @theme-ui/core ships its own (simpler) implementation.

While @theme-ui/theme-provider is in-line with the documentation (BodyStyles, et al), blames suggest both have been updated in relatively recent past - so not sure which is the canonical implementation.

To Reproduce Steps to reproduce the behavior:

  1. Check sources
  2. Notice diverging implementations

(or alternatively, try to use the ThemeProvider from @theme-ui/core and notice it doesn’t touch the body styles).

Expected behavior Both packages implement the same behaviour

Screenshots N/A

Additional context N/A

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
hasparuscommented, Nov 8, 2020

Thanks for the explanation, ackwell! Yup, I can see how it’s confusing now. Okay, I think we can do a few things

  • Rename ThemeProvider in cover to ThemeUICoreProvider.
  • Describe it in the docs. State the difference between the provider here and the provider in theme-ui.
  • Write docs for @theme-ui/theme-provider? It can be used in a MDX+ThemeContext+ColorModes bundle without @theme-ui/components (included in theme-ui), so it could be documented.
2reactions
atanasstercommented, Oct 31, 2020

@ackwell good catch - is seems @theme-ui/theme-provider is just slightly newer (4 months) vs @theme-ui/core (5 months)

imho, we should keep @theme-ui/theme-provider, but since in both cases @hasparus has been involved maybe he has more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

theme-ui/core
As @theme-ui/core defines jsx function and types for it, you can use it to configure JSX runtime without installing theme-ui package. Entry point...
Read more >
Breaking changes in v5, part one: styles and themes - MUI
This is a reference guide to all of the breaking changes introduced in Material v5, and how to handle them when migrating from...
Read more >
Nested ThemeProvider overrides theme style definition
I can't think of a reason you would have to do that. ... import { createTheme, ThemeProvider } from "@material-ui/core/styles"; ...
Read more >
Intro to Theme UI - Janessa Garrow
Theme UI components have a default "variant", which in the case of Button is called "primary". In many cases, there are other built-in...
Read more >
Quickly set up a theme in Material-UI and access it in your ...
Add a customisable Material-UI theme to your React app ... import { ThemeProvider } from '@material-ui/core/styles'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found