siddharthkp / react-ui

Customisable components and primitives based on design tokens
https://react-ui.dev/
418 stars 53 forks source link

Scoped styles for ThemeProvider #104

Closed siddharthkp closed 4 years ago

siddharthkp commented 4 years ago

Built on top of #77

Always prefer :root over 'body'. updated themes.

const components = {
    Global: {
-    body: {
+    ':root': {
        background: 'grays.900',
        color: 'text.body'
      }
    }
  }

Adding scoped on ThemeProvider applies the styles to theme provider root instead of document root 💯

Updated docs: https://react-ui-git-theme-provider.sid.vercel.app/components/ThemeProvider

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sid/react-ui/r56qdvibr
✅ Preview: https://react-ui-git-theme-provider.sid.vercel.app