how to apply styles to material ui code example

Example 1: adding two jss style in material ui styele

function combineStyles(...styles) {
  return function CombineStyles(theme) {
    const outStyles = styles.map((arg) => {
      // Apply the "theme" object for style functions.
      if (typeof arg === 'function') {
        return arg(theme);
      }
      // Objects need no change.
      return arg;
    });

    return outStyles.reduce((acc, val) => Object.assign(acc, val));
  };
}

export default combineStyles;

Example 2: material ui common styles

// with npm
npm install @material-ui/styles

// with yarn
yarn add @material-ui/styles

Tags:

Misc Example