March 2019
Intermediate to advanced
534 pages
14h 52m
English
Let's create a dark theme and a light theme. Both themes will use the same color values for the intentions (primary, secondary, error). The example will use a Storybook control to change themes:

Here's the source that uses this value to choose between a light and dark theme and apply it to the Material-UI components:
import React, { Fragment } from 'react';import { withStyles, createMuiTheme, MuiThemeProvider} from '@material-ui/core/styles';import Button from '@material-ui/core/Button';import Dialog from '@material-ui/core/Dialog';import DialogActions from '@material-ui/core/DialogActions';import DialogContent from '@material-ui/core/DialogContent'; ...Read now
Unlock full access