Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[primer/react] Update documentation on theme overrides #906

Open
cbix opened this issue Dec 18, 2024 · 0 comments
Open

[primer/react] Update documentation on theme overrides #906

cbix opened this issue Dec 18, 2024 · 0 comments

Comments

@cbix
Copy link

cbix commented Dec 18, 2024

Since primer/react v37, most components use CSS variables instead of theme tokens. The documentation only mentions overriding values in the theme object, however this doesn't work anymore for certain colors:

const customTheme = merge(theme, {
  colorSchemes: {
    light: {
      colors: {
        btn: {
          primary: {
            bg: '#cccc00',
          },
        },
      },
    },    
  },    
});
const App = () => (
  <ThemeProvider theme={customTheme}>
    <BaseStyles>
      <Button variant="primary">Hello</Button>
    </BaseStyles>
  </ThemeProvider>
);

Expected:
Screenshot From 2024-12-18 14-28-06
Result:
Screenshot From 2024-12-18 14-28-12

The documentation should be updated so users know how to override theme values in primer/react v37.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant