blob: 1986bc50bf7abdd899d8d5aadd021a437ff4648a [file] [log] [blame]
simon26e79f72022-10-05 22:16:08 -04001/*
2 * Copyright (C) 2022 Savoir-faire Linux Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation; either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public
15 * License along with this program. If not, see
16 * <https://www.gnu.org/licenses/>.
17 */
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -040018import { createTheme, SimplePaletteColorOptions } from '@mui/material';
19
20declare module '@mui/material/styles' {
21 interface Theme {
22 InfoTooltip: {
23 backgroundColor: SimplePaletteColorOptions;
24 color: SimplePaletteColorOptions;
25 };
26 }
27
28 interface ThemeOptions {
29 InfoTooltip: {
30 backgroundColor: SimplePaletteColorOptions;
31 color: SimplePaletteColorOptions;
32 };
33 }
34}
idillon-sfl837ea0b2022-08-25 11:35:29 -040035
idillon-sfldeabd282022-08-25 22:50:03 -040036const theme = createTheme({
37 palette: {
38 primary: {
simond47ef9e2022-09-28 22:24:28 -040039 light: '#E5EEF5', // same as "#0056991A"
40 main: '#0071C9',
41 dark: '#005699',
idillon-sfldeabd282022-08-25 22:50:03 -040042 },
43 error: {
simond47ef9e2022-09-28 22:24:28 -040044 main: '#CC0022',
simonf929a362022-11-18 16:53:45 -050045 dark: '#720013',
idillon-sfldeabd282022-08-25 22:50:03 -040046 },
47 success: {
simond47ef9e2022-09-28 22:24:28 -040048 main: '#009980',
idillon-sfldeabd282022-08-25 22:50:03 -040049 },
Michelle Sepkap Sime51c00452022-10-31 21:26:38 -040050 secondary: {
51 main: '#A3C2DA',
simonf929a362022-11-18 16:53:45 -050052 dark: '#06493F',
Michelle Sepkap Sime51c00452022-10-31 21:26:38 -040053 },
idillon-sfldeabd282022-08-25 22:50:03 -040054 },
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -040055 InfoTooltip: {
56 backgroundColor: {
57 main: '#FFFFFF',
58 },
59 color: {
60 main: '#292929',
61 },
62 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040063 typography: {
simond47ef9e2022-09-28 22:24:28 -040064 fontFamily: 'Ubuntu',
idillon24fe8d82022-08-29 16:55:20 -040065 allVariants: {
simond47ef9e2022-09-28 22:24:28 -040066 color: 'black',
idillon24fe8d82022-08-29 16:55:20 -040067 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040068 h1: {
69 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040070 fontSize: '26px',
71 lineHeight: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040072 },
73 h2: {
74 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040075 fontSize: '22px',
76 lineHeight: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040077 },
78 h3: {
79 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040080 fontSize: '18px',
81 lineHeight: '26px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040082 },
83 h4: {
84 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040085 fontSize: '15px',
86 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040087 },
88 h5: {
89 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040090 fontSize: '13px',
91 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040092 },
93 body1: {
94 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040095 fontSize: '15px',
96 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040097 },
98 body2: {
99 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -0400100 fontSize: '13px',
101 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400102 },
103 caption: {
104 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -0400105 fontSize: '12px',
106 lineHeight: '16px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400107 },
108 },
109 components: {
idillon760b7fb2022-08-29 14:32:38 -0400110 MuiCssBaseline: {
111 styleOverrides: `
112 @font-face {
113 font-family: "Ubuntu";
114 src: url("./fonts/Ubuntu-Th.ttf");
115 font-weight: 100;
116 font-style: normal;
117 }
118 @font-face {
119 font-family: "Ubuntu";
120 src: url("./fonts/Ubuntu-L.ttf");
121 font-weight: 300;
122 font-style: normal;
123 }
124 @font-face {
125 font-family: "Ubuntu";
126 src: url("./fonts/Ubuntu-LI.ttf");
127 font-weight: 300;
128 font-style: italic;
129 }
130 @font-face {
131 font-family: "Ubuntu";
132 src: url("./fonts/Ubuntu-R.ttf");
133 font-weight: 400;
134 font-style: normal;
135 }
136 @font-face {
137 font-family: "Ubuntu";
138 src: url("./fonts/Ubuntu-RI.ttf");
139 font-weight: 400;
140 font-style: italic;
141 }
142 @font-face {
143 font-family: "Ubuntu";
144 src: url("./fonts/Ubuntu-M.ttf");
145 font-weight: 500;
146 font-style: normal;
147 }
148 @font-face {
149 font-family: "Ubuntu";
150 src: url("./fonts/Ubuntu-MI.ttf");
151 font-weight: 500;
152 font-style: italic;
153 }
154 @font-face {
155 font-family: "Ubuntu";
156 src: url("./fonts/Ubuntu-B.ttf");
157 font-weight: 700;
158 font-style: normal;
159 }
160 @font-face {
161 font-family: "Ubuntu";
162 src: url("./fonts/Ubuntu-BI.ttf");
163 font-weight: 700;
164 font-style: italic;
165 }
166 `,
167 },
simond47ef9e2022-09-28 22:24:28 -0400168 },
169});
idillon760b7fb2022-08-29 14:32:38 -0400170
171export default createTheme(theme, {
172 components: {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400173 MuiButton: {
174 styleOverrides: {
175 root: {
simond47ef9e2022-09-28 22:24:28 -0400176 height: '46px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400177 fontWeight: 700,
simond47ef9e2022-09-28 22:24:28 -0400178 fontSize: '15px',
179 lineHeight: '17px',
180 textTransform: 'none',
181 borderRadius: '5px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400182 },
183 sizeSmall: {
simond47ef9e2022-09-28 22:24:28 -0400184 height: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400185 },
186 contained: {
idillon-sfldeabd282022-08-25 22:50:03 -0400187 background: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400188 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400189 background: theme.palette.primary.main,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400190 },
191 },
192 outlined: {
simond47ef9e2022-09-28 22:24:28 -0400193 background: '#FFF',
194 borderColor: '#0056995C',
idillon-sfldeabd282022-08-25 22:50:03 -0400195 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400196 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400197 background: theme.palette.primary.light,
198 borderColor: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400199 },
200 },
201 text: {
simond47ef9e2022-09-28 22:24:28 -0400202 background: '#fff',
idillon-sfldeabd282022-08-25 22:50:03 -0400203 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400204 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400205 background: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400206 },
207 },
208 },
209 },
idillonef9ab812022-11-18 13:46:24 -0500210 MuiDialog: {
211 styleOverrides: {
212 paper: {
213 padding: '16px',
214 boxShadow: '3px 3px 7px #00000029',
215 borderRadius: '20px',
216 },
217 },
218 },
219 MuiDialogActions: {
220 styleOverrides: {
221 root: {
222 padding: '0px',
223 },
224 },
225 },
226 MuiDialogContent: {
227 styleOverrides: {
228 root: {
229 padding: '0px',
230 margin: '16px 0px',
231 minWidth: '500px',
232 },
233 },
234 },
235 MuiDialogTitle: {
236 styleOverrides: {
237 root: {
238 padding: '0px',
239 },
240 },
241 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400242 MuiSwitch: {
243 defaultProps: {
244 disableRipple: true,
245 },
246 styleOverrides: {
247 root: {
simond47ef9e2022-09-28 22:24:28 -0400248 width: '60px',
249 height: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400250 padding: 0,
251 },
252 switchBase: {
253 padding: 0,
simond47ef9e2022-09-28 22:24:28 -0400254 '&.Mui-checked': {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400255 transform: `translateX(30px)`,
256 },
257 },
258 thumb: {
simond47ef9e2022-09-28 22:24:28 -0400259 width: '28px',
260 height: '28px',
idillon-sfldeabd282022-08-25 22:50:03 -0400261 border: `1px solid ${theme.palette.primary.dark}`,
simond47ef9e2022-09-28 22:24:28 -0400262 '.Mui-checked.Mui-checked &': {
263 width: '30px',
264 height: '30px',
265 border: 'none',
266 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400267 },
268 track: {
idillon-sfldeabd282022-08-25 22:50:03 -0400269 backgroundColor: theme.palette.primary.light,
simond47ef9e2022-09-28 22:24:28 -0400270 borderRadius: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400271 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400272 '.Mui-checked.Mui-checked + &': {
idillon-sfldeabd282022-08-25 22:50:03 -0400273 backgroundColor: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400274 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400275 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400276 },
277 colorPrimary: {
simond47ef9e2022-09-28 22:24:28 -0400278 color: '#fff',
279 '&.Mui-checked': {
idillon-sfldeabd282022-08-25 22:50:03 -0400280 color: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400281 },
282 },
283 },
284 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400285 MuiInput: {
286 styleOverrides: {
287 root: {
288 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400289 '&.Mui-error': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400290 color: theme.palette.error.main,
291 },
292 },
293 underline: {
294 /*
295 Material UI uses "before" for the regular underline.
296 There is a second underline called "after" placed over "before"
297 */
simond47ef9e2022-09-28 22:24:28 -0400298 '&:before': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400299 borderBottom: `2px solid ${theme.palette.primary.dark}`,
300 },
simond47ef9e2022-09-28 22:24:28 -0400301 '&:hover:not(.Mui-disabled, .Mui-error):before': {
302 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400303 },
simond47ef9e2022-09-28 22:24:28 -0400304 '&:after': {
305 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400306 },
simond47ef9e2022-09-28 22:24:28 -0400307 '&:hover:not(.Mui-error):after': {
308 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400309 },
310 },
simond47ef9e2022-09-28 22:24:28 -0400311 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400312 },
313 MuiFormControl: {
314 styleOverrides: {
315 root: {
simond47ef9e2022-09-28 22:24:28 -0400316 height: '90px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400317 },
318 },
319 },
320 MuiFormHelperText: {
321 styleOverrides: {
322 root: {
simond47ef9e2022-09-28 22:24:28 -0400323 position: 'absolute',
324 bottom: '0px',
325 fontSize: '15px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400326 },
327 },
328 },
329 MuiInputLabel: {
330 styleOverrides: {
331 root: {
simond47ef9e2022-09-28 22:24:28 -0400332 color: 'black',
333 fontSize: '15px',
334 left: '50%',
335 transform: 'translate(-50%, 20px)',
336 transition: 'left .2s, transform .2s',
idillon-sfl37c18df2022-08-26 18:44:27 -0400337 },
338 shrink: {
simond47ef9e2022-09-28 22:24:28 -0400339 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400340 left: 0,
simond47ef9e2022-09-28 22:24:28 -0400341 transform: 'translate(0, 50px) scale(0.75)',
342 transition: 'left .2s, transform .2s',
343 '&.Mui-focused, &.Mui-error': {
344 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400345 },
346 },
347 },
348 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400349 },
simond47ef9e2022-09-28 22:24:28 -0400350});