Skip to content

Instantly share code, notes, and snippets.

@adrianhajdin
Created December 20, 2020 15:07
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save adrianhajdin/58d4454849ab9a602f9800380d935e45 to your computer and use it in GitHub Desktop.
Save adrianhajdin/58d4454849ab9a602f9800380d935e45 to your computer and use it in GitHub Desktop.
Styles for an Expense Tracker Web Tutorial
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles((theme) => ({
desktop: {
[theme.breakpoints.up('sm')]: {
display: 'none',
},
},
mobile: {
[theme.breakpoints.down('sm')]: {
display: 'none',
},
},
main: {
[theme.breakpoints.up('sm')]: {
paddingBottom: '5%',
},
},
last: {
[theme.breakpoints.down('sm')]: {
marginBottom: theme.spacing(3),
paddingBottom: '200px',
},
},
grid: {
'& > *': {
margin: theme.spacing(2),
},
},
}));
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles(() => ({
income: {
borderBottom: '10px solid rgba(0, 255, 0, 0.5)',
},
expense: {
borderBottom: '10px solid rgba(255, 0, 0, 0.5)',
},
}));
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles(() => ({
radioGroup: {
display: 'flex',
justifyContent: 'center',
marginBottom: '-10px',
},
button: {
marginTop: '20px',
},
}));
import { makeStyles } from '@material-ui/core/styles';
import { red, green } from '@material-ui/core/colors';
export default makeStyles((theme) => ({
avatarIncome: {
color: '#fff',
backgroundColor: green[500],
},
avatarExpense: {
color: theme.palette.getContrastText(red[500]),
backgroundColor: red[500],
},
list: {
maxHeight: '150px',
overflow: 'auto',
},
}));
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles((theme) => ({
media: {
height: 0,
paddingTop: '56.25%', // 16:9
},
expand: {
transform: 'rotate(0deg)',
marginLeft: 'auto',
transition: theme.transitions.create('transform', {
duration: theme.transitions.duration.shortest,
}),
},
expandOpen: {
transform: 'rotate(180deg)',
},
cartContent: {
paddingTop: 0,
},
divider: {
margin: '20px 0',
},
}));
import { makeStyles } from '@material-ui/core/styles';
export default makeStyles((theme) => ({
root: {
width: '100%',
'& > * + *': {
marginTop: theme.spacing(2),
},
},
}));
@zayeed-bs
Copy link

zayeed-bs commented Dec 27, 2020

Hey there, man! Nice work on these styles. Just to mention that in mainStyles.js line-18, it should be "Card", instead of "Cart". Thanks for making the tutorial! Hope to see you make these more!

@iamAravindks
Copy link

Hey, Cool Styles. for more responsive in a range of 600-959 (iPad and iPad Pro) in line-10 change "sm" to "xs".Thanks for the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment