Permalink
Newer
100644
43 lines (38 sloc)
1.09 KB
3
import deepmerge from 'deepmerge'; // < 1kb payload overhead when lodash/merge is > 3kb.
4
import createTypography from './createTypography';
5
import createBreakpoints from './createBreakpoints';
6
import createPalette from './createPalette';
7
import createMixins from './createMixins';
10
import zIndex from './zIndex';
11
import spacing from './spacing';
12
13
function createMuiTheme(options: Object = {}) {
14
const {
15
palette: paletteInput = {},
16
breakpoints: breakpointsInput = {},
17
mixins: mixinsInput = {},
18
typography: typographyInput = {},
19
...other
20
} = options;
21
22
const palette = createPalette(paletteInput);
23
const breakpoints = createBreakpoints(breakpointsInput);
24
25
return {
26
direction: 'ltr',
27
palette,
28
typography: createTypography(palette, typographyInput),
29
mixins: createMixins(breakpoints, spacing, mixinsInput),
31
...deepmerge(
32
{
33
shadows,
34
transitions,
35
spacing,
36
zIndex,
37
},
38
other,
39
),