blob: 977de0b6ae052c1bac088c87c560a9971530d260 [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',
idillon-sfldeabd282022-08-25 22:50:03 -040045 },
46 success: {
simond47ef9e2022-09-28 22:24:28 -040047 main: '#009980',
idillon-sfldeabd282022-08-25 22:50:03 -040048 },
Michelle Sepkap Sime51c00452022-10-31 21:26:38 -040049 secondary: {
50 main: '#A3C2DA',
51 },
idillon-sfldeabd282022-08-25 22:50:03 -040052 },
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -040053 InfoTooltip: {
54 backgroundColor: {
55 main: '#FFFFFF',
56 },
57 color: {
58 main: '#292929',
59 },
60 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040061 typography: {
simond47ef9e2022-09-28 22:24:28 -040062 fontFamily: 'Ubuntu',
idillon24fe8d82022-08-29 16:55:20 -040063 allVariants: {
simond47ef9e2022-09-28 22:24:28 -040064 color: 'black',
idillon24fe8d82022-08-29 16:55:20 -040065 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040066 h1: {
67 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040068 fontSize: '26px',
69 lineHeight: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040070 },
71 h2: {
72 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040073 fontSize: '22px',
74 lineHeight: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040075 },
76 h3: {
77 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040078 fontSize: '18px',
79 lineHeight: '26px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040080 },
81 h4: {
82 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040083 fontSize: '15px',
84 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040085 },
86 h5: {
87 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040088 fontSize: '13px',
89 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040090 },
91 body1: {
92 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040093 fontSize: '15px',
94 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040095 },
96 body2: {
97 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040098 fontSize: '13px',
99 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400100 },
101 caption: {
102 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -0400103 fontSize: '12px',
104 lineHeight: '16px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400105 },
106 },
107 components: {
idillon760b7fb2022-08-29 14:32:38 -0400108 MuiCssBaseline: {
109 styleOverrides: `
110 @font-face {
111 font-family: "Ubuntu";
112 src: url("./fonts/Ubuntu-Th.ttf");
113 font-weight: 100;
114 font-style: normal;
115 }
116 @font-face {
117 font-family: "Ubuntu";
118 src: url("./fonts/Ubuntu-L.ttf");
119 font-weight: 300;
120 font-style: normal;
121 }
122 @font-face {
123 font-family: "Ubuntu";
124 src: url("./fonts/Ubuntu-LI.ttf");
125 font-weight: 300;
126 font-style: italic;
127 }
128 @font-face {
129 font-family: "Ubuntu";
130 src: url("./fonts/Ubuntu-R.ttf");
131 font-weight: 400;
132 font-style: normal;
133 }
134 @font-face {
135 font-family: "Ubuntu";
136 src: url("./fonts/Ubuntu-RI.ttf");
137 font-weight: 400;
138 font-style: italic;
139 }
140 @font-face {
141 font-family: "Ubuntu";
142 src: url("./fonts/Ubuntu-M.ttf");
143 font-weight: 500;
144 font-style: normal;
145 }
146 @font-face {
147 font-family: "Ubuntu";
148 src: url("./fonts/Ubuntu-MI.ttf");
149 font-weight: 500;
150 font-style: italic;
151 }
152 @font-face {
153 font-family: "Ubuntu";
154 src: url("./fonts/Ubuntu-B.ttf");
155 font-weight: 700;
156 font-style: normal;
157 }
158 @font-face {
159 font-family: "Ubuntu";
160 src: url("./fonts/Ubuntu-BI.ttf");
161 font-weight: 700;
162 font-style: italic;
163 }
164 `,
165 },
simond47ef9e2022-09-28 22:24:28 -0400166 },
167});
idillon760b7fb2022-08-29 14:32:38 -0400168
169export default createTheme(theme, {
170 components: {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400171 MuiButton: {
172 styleOverrides: {
173 root: {
simond47ef9e2022-09-28 22:24:28 -0400174 height: '46px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400175 fontWeight: 700,
simond47ef9e2022-09-28 22:24:28 -0400176 fontSize: '15px',
177 lineHeight: '17px',
178 textTransform: 'none',
179 borderRadius: '5px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400180 },
181 sizeSmall: {
simond47ef9e2022-09-28 22:24:28 -0400182 height: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400183 },
184 contained: {
idillon-sfldeabd282022-08-25 22:50:03 -0400185 background: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400186 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400187 background: theme.palette.primary.main,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400188 },
189 },
190 outlined: {
simond47ef9e2022-09-28 22:24:28 -0400191 background: '#FFF',
192 borderColor: '#0056995C',
idillon-sfldeabd282022-08-25 22:50:03 -0400193 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400194 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400195 background: theme.palette.primary.light,
196 borderColor: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400197 },
198 },
199 text: {
simond47ef9e2022-09-28 22:24:28 -0400200 background: '#fff',
idillon-sfldeabd282022-08-25 22:50:03 -0400201 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400202 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400203 background: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400204 },
205 },
206 },
207 },
idillonef9ab812022-11-18 13:46:24 -0500208 MuiDialog: {
209 styleOverrides: {
210 paper: {
211 padding: '16px',
212 boxShadow: '3px 3px 7px #00000029',
213 borderRadius: '20px',
214 },
215 },
216 },
217 MuiDialogActions: {
218 styleOverrides: {
219 root: {
220 padding: '0px',
221 },
222 },
223 },
224 MuiDialogContent: {
225 styleOverrides: {
226 root: {
227 padding: '0px',
228 margin: '16px 0px',
229 minWidth: '500px',
230 },
231 },
232 },
233 MuiDialogTitle: {
234 styleOverrides: {
235 root: {
236 padding: '0px',
237 },
238 },
239 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400240 MuiSwitch: {
241 defaultProps: {
242 disableRipple: true,
243 },
244 styleOverrides: {
245 root: {
simond47ef9e2022-09-28 22:24:28 -0400246 width: '60px',
247 height: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400248 padding: 0,
249 },
250 switchBase: {
251 padding: 0,
simond47ef9e2022-09-28 22:24:28 -0400252 '&.Mui-checked': {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400253 transform: `translateX(30px)`,
254 },
255 },
256 thumb: {
simond47ef9e2022-09-28 22:24:28 -0400257 width: '28px',
258 height: '28px',
idillon-sfldeabd282022-08-25 22:50:03 -0400259 border: `1px solid ${theme.palette.primary.dark}`,
simond47ef9e2022-09-28 22:24:28 -0400260 '.Mui-checked.Mui-checked &': {
261 width: '30px',
262 height: '30px',
263 border: 'none',
264 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400265 },
266 track: {
idillon-sfldeabd282022-08-25 22:50:03 -0400267 backgroundColor: theme.palette.primary.light,
simond47ef9e2022-09-28 22:24:28 -0400268 borderRadius: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400269 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400270 '.Mui-checked.Mui-checked + &': {
idillon-sfldeabd282022-08-25 22:50:03 -0400271 backgroundColor: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400272 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400273 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400274 },
275 colorPrimary: {
simond47ef9e2022-09-28 22:24:28 -0400276 color: '#fff',
277 '&.Mui-checked': {
idillon-sfldeabd282022-08-25 22:50:03 -0400278 color: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400279 },
280 },
281 },
282 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400283 MuiInput: {
284 styleOverrides: {
285 root: {
286 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400287 '&.Mui-error': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400288 color: theme.palette.error.main,
289 },
290 },
291 underline: {
292 /*
293 Material UI uses "before" for the regular underline.
294 There is a second underline called "after" placed over "before"
295 */
simond47ef9e2022-09-28 22:24:28 -0400296 '&:before': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400297 borderBottom: `2px solid ${theme.palette.primary.dark}`,
298 },
simond47ef9e2022-09-28 22:24:28 -0400299 '&:hover:not(.Mui-disabled, .Mui-error):before': {
300 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400301 },
simond47ef9e2022-09-28 22:24:28 -0400302 '&:after': {
303 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400304 },
simond47ef9e2022-09-28 22:24:28 -0400305 '&:hover:not(.Mui-error):after': {
306 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400307 },
308 },
simond47ef9e2022-09-28 22:24:28 -0400309 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400310 },
311 MuiFormControl: {
312 styleOverrides: {
313 root: {
simond47ef9e2022-09-28 22:24:28 -0400314 height: '90px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400315 },
316 },
317 },
318 MuiFormHelperText: {
319 styleOverrides: {
320 root: {
simond47ef9e2022-09-28 22:24:28 -0400321 position: 'absolute',
322 bottom: '0px',
323 fontSize: '15px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400324 },
325 },
326 },
327 MuiInputLabel: {
328 styleOverrides: {
329 root: {
simond47ef9e2022-09-28 22:24:28 -0400330 color: 'black',
331 fontSize: '15px',
332 left: '50%',
333 transform: 'translate(-50%, 20px)',
334 transition: 'left .2s, transform .2s',
idillon-sfl37c18df2022-08-26 18:44:27 -0400335 },
336 shrink: {
simond47ef9e2022-09-28 22:24:28 -0400337 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400338 left: 0,
simond47ef9e2022-09-28 22:24:28 -0400339 transform: 'translate(0, 50px) scale(0.75)',
340 transition: 'left .2s, transform .2s',
341 '&.Mui-focused, &.Mui-error': {
342 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400343 },
344 },
345 },
346 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400347 },
simond47ef9e2022-09-28 22:24:28 -0400348});