Skip to content

Instantly share code, notes, and snippets.

@LarryKarani
Last active May 4, 2020 05:20
Show Gist options
  • Save LarryKarani/13c6546b52d2ee20190d6790621c53ae to your computer and use it in GitHub Desktop.
Save LarryKarani/13c6546b52d2ee20190d6790621c53ae to your computer and use it in GitHub Desktop.
import React from 'react';
import styled, { ThemeProvider } from 'styled-componets';
const theme = {
text: '#ffff',
dark: '#0000'
}
const CustomButton = styled.button`
background-color: ${props => props.theme.dark};
color: ${ props => props.theme.text};
cursor: pointer;
font-size: 16px;
border-radius: 3px;
border: 2px solid palevioletred;
margin: 0 1em;
padding: 0.25em 1em;
`
const App = () => {
return (
<div>
<h1> Stlyed Button </h1>
<ThemeProvider theme={theme}>
<CustomButton>Themed button </CustomButton>
</ThemeProvider>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment