Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created November 9, 2022 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/f1fa8764aa27063accfb51ab624b9a71 to your computer and use it in GitHub Desktop.
Save BetterProgramming/f1fa8764aa27063accfb51ab624b9a71 to your computer and use it in GitHub Desktop.
import styled from 'styled-components';
const StyledButton = styled(Button)`
color: ${({ theme }) => theme.colors.primary};
`;
const primary = 'green';
const theme = {
colors: {
primary,
}
}
import { ThemeProvider } from 'styled-components';
const SubmitButton = () => {
return (
<ThemeProvider theme={theme}>
<StyledButton>Themed Button</StyledButton>
</ThemeProvider>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment