You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because of how they are referenced in a theme-agnostic way by Reach UI style overrides (for things like tooltips and context menus).
Can we do better here, at least to ensure they stay in sync? For example, can the ThemeProvider set the redundant values at the root level when the SettingsContext theme changes?
The primary goals of the current architecture are:
Don't bleed styles into the global namespace (for our inline package users like Code Sandbox or Replay IO).
Don't require awkward forced layout or re-renders for components that read style values programatically.
I was looking into it and here is what I have in mind:
Exposing all vars using style prop to reach-ui components which will be rendered in Portal (outside the rendered DOM), and we can create wrapper component or re-export the same component by passing all vars:
Activity
jyash97 commentedon Nov 2, 2021
I was looking into it and here is what I have in mind:
Exposing all vars using
styleprop to reach-ui components which will be rendered in Portal (outside the rendered DOM), and we can create wrapper component or re-export the same component by passing all vars:Example: https://codesandbox.io/s/quiet-fast-exg5q?file=/src/App.js
childrenwill have access to those CSS variables and we can style without adding custom variables inroot.cssbvaughn commentedon Nov 3, 2021
@jyash97 Oh! That's a very eloquent solution!
So DevTools can just re-export the components we use, with the style decoration. Love it!
jyash97 commentedon Nov 3, 2021
Glad you liked it 😄
Can I create a draft PR for the above solution ?
bvaughn commentedon Nov 3, 2021
Yes, please do!