Skip to content

Instantly share code, notes, and snippets.

@alexdisdier
Last active March 10, 2020 05:21
Show Gist options
  • Save alexdisdier/9fdde2c8cbe1965c8ee8614580343158 to your computer and use it in GitHub Desktop.
Save alexdisdier/9fdde2c8cbe1965c8ee8614580343158 to your computer and use it in GitHub Desktop.
A basic react button stylesheet using react-jss
import { createUseStyles } from 'react-jss';
export default createUseStyles((theme: any) => ({
root: {
color: (props: { color: string }) => props.color || theme.colorPrimary,
backgroundColor: 'white',
borderWidth: 1,
borderColor: (props: { color: string }) =>
props.color || theme.colorPrimary,
padding: '15px 32px',
transition: 'all 250ms',
'&:not([disabled])&:hover': {
color: 'white',
backgroundColor: (props: { color: string }) =>
props.color || theme.colorPrimary
},
'&:focus': {
outline: 'none'
},
'&[disabled]': {
opacity: 0.3,
cursor: 'unset'
}
},
label: {
fontWeight: 'bold'
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment