blob: 60fb1ecd57b8c78f625ab4a14b40fd5fc2f1c675 [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 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400208 MuiSwitch: {
209 defaultProps: {
210 disableRipple: true,
211 },
212 styleOverrides: {
213 root: {
simond47ef9e2022-09-28 22:24:28 -0400214 width: '60px',
215 height: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400216 padding: 0,
217 },
218 switchBase: {
219 padding: 0,
simond47ef9e2022-09-28 22:24:28 -0400220 '&.Mui-checked': {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400221 transform: `translateX(30px)`,
222 },
223 },
224 thumb: {
simond47ef9e2022-09-28 22:24:28 -0400225 width: '28px',
226 height: '28px',
idillon-sfldeabd282022-08-25 22:50:03 -0400227 border: `1px solid ${theme.palette.primary.dark}`,
simond47ef9e2022-09-28 22:24:28 -0400228 '.Mui-checked.Mui-checked &': {
229 width: '30px',
230 height: '30px',
231 border: 'none',
232 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400233 },
234 track: {
idillon-sfldeabd282022-08-25 22:50:03 -0400235 backgroundColor: theme.palette.primary.light,
simond47ef9e2022-09-28 22:24:28 -0400236 borderRadius: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400237 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400238 '.Mui-checked.Mui-checked + &': {
idillon-sfldeabd282022-08-25 22:50:03 -0400239 backgroundColor: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400240 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400241 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400242 },
243 colorPrimary: {
simond47ef9e2022-09-28 22:24:28 -0400244 color: '#fff',
245 '&.Mui-checked': {
idillon-sfldeabd282022-08-25 22:50:03 -0400246 color: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400247 },
248 },
249 },
250 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400251 MuiInput: {
252 styleOverrides: {
253 root: {
254 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400255 '&.Mui-error': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400256 color: theme.palette.error.main,
257 },
258 },
259 underline: {
260 /*
261 Material UI uses "before" for the regular underline.
262 There is a second underline called "after" placed over "before"
263 */
simond47ef9e2022-09-28 22:24:28 -0400264 '&:before': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400265 borderBottom: `2px solid ${theme.palette.primary.dark}`,
266 },
simond47ef9e2022-09-28 22:24:28 -0400267 '&:hover:not(.Mui-disabled, .Mui-error):before': {
268 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400269 },
simond47ef9e2022-09-28 22:24:28 -0400270 '&:after': {
271 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400272 },
simond47ef9e2022-09-28 22:24:28 -0400273 '&:hover:not(.Mui-error):after': {
274 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400275 },
276 },
simond47ef9e2022-09-28 22:24:28 -0400277 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400278 },
279 MuiFormControl: {
280 styleOverrides: {
281 root: {
simond47ef9e2022-09-28 22:24:28 -0400282 height: '90px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400283 },
284 },
285 },
286 MuiFormHelperText: {
287 styleOverrides: {
288 root: {
simond47ef9e2022-09-28 22:24:28 -0400289 position: 'absolute',
290 bottom: '0px',
291 fontSize: '15px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400292 },
293 },
294 },
295 MuiInputLabel: {
296 styleOverrides: {
297 root: {
simond47ef9e2022-09-28 22:24:28 -0400298 color: 'black',
299 fontSize: '15px',
300 left: '50%',
301 transform: 'translate(-50%, 20px)',
302 transition: 'left .2s, transform .2s',
idillon-sfl37c18df2022-08-26 18:44:27 -0400303 },
304 shrink: {
simond47ef9e2022-09-28 22:24:28 -0400305 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400306 left: 0,
simond47ef9e2022-09-28 22:24:28 -0400307 transform: 'translate(0, 50px) scale(0.75)',
308 transition: 'left .2s, transform .2s',
309 '&.Mui-focused, &.Mui-error': {
310 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400311 },
312 },
313 },
314 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400315 },
simond47ef9e2022-09-28 22:24:28 -0400316});