-
Notifications
You must be signed in to change notification settings - Fork 16
/
carto-theme.js
129 lines (125 loc) · 3.94 KB
/
carto-theme.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import { createTheme, responsiveFontSizes } from '@mui/material';
import { dataDisplayOverrides } from './sections/components/dataDisplay';
import { buttonsOverrides } from './sections/components/buttons';
import { formsOverrides } from './sections/components/forms';
import { navigationOverrides } from './sections/components/navigation';
import { CssBaseline } from './sections/cssBaseline';
import { commonPalette } from './sections/palette';
import { themeShadows } from './sections/shadows';
import { themeTypography } from './sections/typography';
import { feedbackOverrides } from './sections/components/feedback';
import { surfacesOverrides } from './sections/components/surfaces';
import { BREAKPOINTS, SPACING } from './themeConstants';
export const cartoThemeOptions = {
themeName: 'CARTO',
breakpoints: {
keys: ['xs', 'sm', 'md', 'lg', 'xl'],
values: {
xs: BREAKPOINTS.XS, // 320 - 599
sm: BREAKPOINTS.SM, // 600 - 959
md: BREAKPOINTS.MD, // 960 - 1279
lg: BREAKPOINTS.LG, // 1280 - 1599
xl: BREAKPOINTS.XL // 1600+
},
unit: 'px',
step: 5
// For more information about use this helper functions: https://mui.com/material-ui/customization/breakpoints/#css-media-queries
// up: f d(),
// down: f down(),
// between: f p(),
// only: f only(),
// width: f width(),
},
direction: 'ltr',
mixins: {
// gutters: f gutters(),
toolbar: {
minHeight: 56,
'@media (min-width:0px) and (orientation: landscape)': {
minHeight: 48
},
'@media (min-width:600px)': {
minHeight: 56
}
}
},
palette: {
mode: 'light',
// Used by `getContrastText()` to maximize the contrast between the background and the text.
// https://mui.com/material-ui/customization/palette/#accessibility
contrastThreshold: 3,
tonalOffset: 0.2,
common: { ...commonPalette.common },
primary: { ...commonPalette.primary },
secondary: { ...commonPalette.secondary },
error: { ...commonPalette.error },
warning: { ...commonPalette.warning },
info: { ...commonPalette.info },
success: { ...commonPalette.success },
text: { ...commonPalette.text },
divider: commonPalette.divider,
background: { ...commonPalette.background },
grey: { ...commonPalette.grey },
action: { ...commonPalette.action },
// props: Object => Research,
/* Custom Colors palette */
qualitative: { ...commonPalette.qualitative },
default: { ...commonPalette.default },
white: { ...commonPalette.white },
black: { ...commonPalette.black },
brand: { ...commonPalette.brand }
},
shadows: [...themeShadows],
typography: {
...themeTypography
},
spacingValue: SPACING, // For situations where we can't use theme.spacing(), mainly math calculations.
spacing: SPACING, // For custom spacing: https://material-ui.com/customization/spacing/#custom-spacing
shape: {
borderRadius: 4
},
transitions: {
easing: {
easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
},
duration: {
shortest: 150,
shorter: 200,
short: 250,
standard: 300,
complex: 375,
enteringScreen: 225,
leavingScreen: 195
}
// create: f create(), => Research
// getAutoHeightDuration: f getAutoHeightDuration(), => Research
},
zIndex: {
mobileStepper: 1000,
speedDial: 1050,
appBar: 1100,
drawer: 1200,
modal: 1300,
snackbar: 1400,
tooltip: 1500
},
// Styles and props overrides for components
components: {
MuiCssBaseline: {
styleOverrides: {
...CssBaseline
}
},
...buttonsOverrides,
...formsOverrides,
...navigationOverrides,
...dataDisplayOverrides,
...feedbackOverrides,
...surfacesOverrides
}
};
// @ts-ignore
export const theme = responsiveFontSizes(createTheme(cartoThemeOptions));