blob: c0f5884bf325a3916d1a9632a7a6c615518f3dbb [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 },
49 },
Michelle Sepkap Simef5ebc2e2022-10-27 18:30:53 -040050 InfoTooltip: {
51 backgroundColor: {
52 main: '#FFFFFF',
53 },
54 color: {
55 main: '#292929',
56 },
57 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040058 typography: {
simond47ef9e2022-09-28 22:24:28 -040059 fontFamily: 'Ubuntu',
idillon24fe8d82022-08-29 16:55:20 -040060 allVariants: {
simond47ef9e2022-09-28 22:24:28 -040061 color: 'black',
idillon24fe8d82022-08-29 16:55:20 -040062 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040063 h1: {
64 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040065 fontSize: '26px',
66 lineHeight: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040067 },
68 h2: {
69 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040070 fontSize: '22px',
71 lineHeight: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040072 },
73 h3: {
74 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040075 fontSize: '18px',
76 lineHeight: '26px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040077 },
78 h4: {
79 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040080 fontSize: '15px',
81 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040082 },
83 h5: {
84 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040085 fontSize: '13px',
86 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040087 },
88 body1: {
89 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040090 fontSize: '15px',
91 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040092 },
93 body2: {
94 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040095 fontSize: '13px',
96 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040097 },
98 caption: {
99 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -0400100 fontSize: '12px',
101 lineHeight: '16px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400102 },
103 },
104 components: {
idillon760b7fb2022-08-29 14:32:38 -0400105 MuiCssBaseline: {
106 styleOverrides: `
107 @font-face {
108 font-family: "Ubuntu";
109 src: url("./fonts/Ubuntu-Th.ttf");
110 font-weight: 100;
111 font-style: normal;
112 }
113 @font-face {
114 font-family: "Ubuntu";
115 src: url("./fonts/Ubuntu-L.ttf");
116 font-weight: 300;
117 font-style: normal;
118 }
119 @font-face {
120 font-family: "Ubuntu";
121 src: url("./fonts/Ubuntu-LI.ttf");
122 font-weight: 300;
123 font-style: italic;
124 }
125 @font-face {
126 font-family: "Ubuntu";
127 src: url("./fonts/Ubuntu-R.ttf");
128 font-weight: 400;
129 font-style: normal;
130 }
131 @font-face {
132 font-family: "Ubuntu";
133 src: url("./fonts/Ubuntu-RI.ttf");
134 font-weight: 400;
135 font-style: italic;
136 }
137 @font-face {
138 font-family: "Ubuntu";
139 src: url("./fonts/Ubuntu-M.ttf");
140 font-weight: 500;
141 font-style: normal;
142 }
143 @font-face {
144 font-family: "Ubuntu";
145 src: url("./fonts/Ubuntu-MI.ttf");
146 font-weight: 500;
147 font-style: italic;
148 }
149 @font-face {
150 font-family: "Ubuntu";
151 src: url("./fonts/Ubuntu-B.ttf");
152 font-weight: 700;
153 font-style: normal;
154 }
155 @font-face {
156 font-family: "Ubuntu";
157 src: url("./fonts/Ubuntu-BI.ttf");
158 font-weight: 700;
159 font-style: italic;
160 }
161 `,
162 },
simond47ef9e2022-09-28 22:24:28 -0400163 },
164});
idillon760b7fb2022-08-29 14:32:38 -0400165
166export default createTheme(theme, {
167 components: {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400168 MuiButton: {
169 styleOverrides: {
170 root: {
simond47ef9e2022-09-28 22:24:28 -0400171 height: '46px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400172 fontWeight: 700,
simond47ef9e2022-09-28 22:24:28 -0400173 fontSize: '15px',
174 lineHeight: '17px',
175 textTransform: 'none',
176 borderRadius: '5px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400177 },
178 sizeSmall: {
simond47ef9e2022-09-28 22:24:28 -0400179 height: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400180 },
181 contained: {
idillon-sfldeabd282022-08-25 22:50:03 -0400182 background: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400183 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400184 background: theme.palette.primary.main,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400185 },
186 },
187 outlined: {
simond47ef9e2022-09-28 22:24:28 -0400188 background: '#FFF',
189 borderColor: '#0056995C',
idillon-sfldeabd282022-08-25 22:50:03 -0400190 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400191 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400192 background: theme.palette.primary.light,
193 borderColor: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400194 },
195 },
196 text: {
simond47ef9e2022-09-28 22:24:28 -0400197 background: '#fff',
idillon-sfldeabd282022-08-25 22:50:03 -0400198 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400199 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400200 background: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400201 },
202 },
203 },
204 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400205 MuiSwitch: {
206 defaultProps: {
207 disableRipple: true,
208 },
209 styleOverrides: {
210 root: {
simond47ef9e2022-09-28 22:24:28 -0400211 width: '60px',
212 height: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400213 padding: 0,
214 },
215 switchBase: {
216 padding: 0,
simond47ef9e2022-09-28 22:24:28 -0400217 '&.Mui-checked': {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400218 transform: `translateX(30px)`,
219 },
220 },
221 thumb: {
simond47ef9e2022-09-28 22:24:28 -0400222 width: '28px',
223 height: '28px',
idillon-sfldeabd282022-08-25 22:50:03 -0400224 border: `1px solid ${theme.palette.primary.dark}`,
simond47ef9e2022-09-28 22:24:28 -0400225 '.Mui-checked.Mui-checked &': {
226 width: '30px',
227 height: '30px',
228 border: 'none',
229 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400230 },
231 track: {
idillon-sfldeabd282022-08-25 22:50:03 -0400232 backgroundColor: theme.palette.primary.light,
simond47ef9e2022-09-28 22:24:28 -0400233 borderRadius: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400234 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400235 '.Mui-checked.Mui-checked + &': {
idillon-sfldeabd282022-08-25 22:50:03 -0400236 backgroundColor: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400237 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400238 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400239 },
240 colorPrimary: {
simond47ef9e2022-09-28 22:24:28 -0400241 color: '#fff',
242 '&.Mui-checked': {
idillon-sfldeabd282022-08-25 22:50:03 -0400243 color: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400244 },
245 },
246 },
247 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400248 MuiInput: {
249 styleOverrides: {
250 root: {
251 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400252 '&.Mui-error': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400253 color: theme.palette.error.main,
254 },
255 },
256 underline: {
257 /*
258 Material UI uses "before" for the regular underline.
259 There is a second underline called "after" placed over "before"
260 */
simond47ef9e2022-09-28 22:24:28 -0400261 '&:before': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400262 borderBottom: `2px solid ${theme.palette.primary.dark}`,
263 },
simond47ef9e2022-09-28 22:24:28 -0400264 '&:hover:not(.Mui-disabled, .Mui-error):before': {
265 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400266 },
simond47ef9e2022-09-28 22:24:28 -0400267 '&:after': {
268 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400269 },
simond47ef9e2022-09-28 22:24:28 -0400270 '&:hover:not(.Mui-error):after': {
271 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400272 },
273 },
simond47ef9e2022-09-28 22:24:28 -0400274 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400275 },
276 MuiFormControl: {
277 styleOverrides: {
278 root: {
simond47ef9e2022-09-28 22:24:28 -0400279 height: '90px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400280 },
281 },
282 },
283 MuiFormHelperText: {
284 styleOverrides: {
285 root: {
simond47ef9e2022-09-28 22:24:28 -0400286 position: 'absolute',
287 bottom: '0px',
288 fontSize: '15px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400289 },
290 },
291 },
292 MuiInputLabel: {
293 styleOverrides: {
294 root: {
simond47ef9e2022-09-28 22:24:28 -0400295 color: 'black',
296 fontSize: '15px',
297 left: '50%',
298 transform: 'translate(-50%, 20px)',
299 transition: 'left .2s, transform .2s',
idillon-sfl37c18df2022-08-26 18:44:27 -0400300 },
301 shrink: {
simond47ef9e2022-09-28 22:24:28 -0400302 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400303 left: 0,
simond47ef9e2022-09-28 22:24:28 -0400304 transform: 'translate(0, 50px) scale(0.75)',
305 transition: 'left .2s, transform .2s',
306 '&.Mui-focused, &.Mui-error': {
307 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400308 },
309 },
310 },
311 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400312 },
simond47ef9e2022-09-28 22:24:28 -0400313});