Skip to content

Instantly share code, notes, and snippets.

@akinogu
Created October 14, 2021 12:09
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 akinogu/c5d25e256b94b1e83982ef945b71aa19 to your computer and use it in GitHub Desktop.
Save akinogu/c5d25e256b94b1e83982ef945b71aa19 to your computer and use it in GitHub Desktop.
[styled-components]theme
import styled, { ThemeProvider } from 'styled-components'
const Button = styled.button`
color: ${p => p.theme.color}; // ← green
`
export const App = () => {
return (
<ThemeProvider theme={{ color: 'green' }}>
<Button>Themed</Button>
</ThemeProvider>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment