March 2019
Intermediate to advanced
534 pages
14h 52m
English
Each style is destructured from the classes property, then applied to the appropriate Button component. However, you don't actually need to do all of this work. Since the Material-UI CSS API takes care of applying styles to components in a way that matches what you're actually targeting, you can just pass the classes directly to the buttons and get the same result. Here's a simplified version of this example:
import React, { Fragment } from 'react';import { withStyles } from '@material-ui/core/styles';import Button from '@material-ui/core/Button';const styles = theme => ({ root: { margin: theme.spacing(2) }, contained: { paddingTop: theme.spacing(2), paddingBottom: theme.spacing(2) }, containedPrimary: { paddingLeft: theme.spacing(4), ...Read now
Unlock full access