simon | 26e79f7 | 2022-10-05 22:16:08 -0400 | [diff] [blame] | 1 | /* |
| 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 | */ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 18 | import { createTheme } from '@mui/material'; |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 19 | |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 20 | const theme = createTheme({ |
| 21 | palette: { |
| 22 | primary: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 23 | light: '#E5EEF5', // same as "#0056991A" |
| 24 | main: '#0071C9', |
| 25 | dark: '#005699', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 26 | }, |
| 27 | error: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 28 | main: '#CC0022', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 29 | }, |
| 30 | success: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 31 | main: '#009980', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 32 | }, |
| 33 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 34 | typography: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 35 | fontFamily: 'Ubuntu', |
idillon | 24fe8d8 | 2022-08-29 16:55:20 -0400 | [diff] [blame] | 36 | allVariants: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 37 | color: 'black', |
idillon | 24fe8d8 | 2022-08-29 16:55:20 -0400 | [diff] [blame] | 38 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 39 | h1: { |
| 40 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 41 | fontSize: '26px', |
| 42 | lineHeight: '36px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 43 | }, |
| 44 | h2: { |
| 45 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 46 | fontSize: '22px', |
| 47 | lineHeight: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 48 | }, |
| 49 | h3: { |
| 50 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 51 | fontSize: '18px', |
| 52 | lineHeight: '26px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 53 | }, |
| 54 | h4: { |
| 55 | fontWeight: 500, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 56 | fontSize: '15px', |
| 57 | lineHeight: '22px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 58 | }, |
| 59 | h5: { |
| 60 | fontWeight: 500, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 61 | fontSize: '13px', |
| 62 | lineHeight: '19px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 63 | }, |
| 64 | body1: { |
| 65 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 66 | fontSize: '15px', |
| 67 | lineHeight: '22px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 68 | }, |
| 69 | body2: { |
| 70 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 71 | fontSize: '13px', |
| 72 | lineHeight: '19px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 73 | }, |
| 74 | caption: { |
| 75 | fontWeight: 400, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 76 | fontSize: '12px', |
| 77 | lineHeight: '16px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 78 | }, |
| 79 | }, |
| 80 | components: { |
idillon | 760b7fb | 2022-08-29 14:32:38 -0400 | [diff] [blame] | 81 | MuiCssBaseline: { |
| 82 | styleOverrides: ` |
| 83 | @font-face { |
| 84 | font-family: "Ubuntu"; |
| 85 | src: url("./fonts/Ubuntu-Th.ttf"); |
| 86 | font-weight: 100; |
| 87 | font-style: normal; |
| 88 | } |
| 89 | @font-face { |
| 90 | font-family: "Ubuntu"; |
| 91 | src: url("./fonts/Ubuntu-L.ttf"); |
| 92 | font-weight: 300; |
| 93 | font-style: normal; |
| 94 | } |
| 95 | @font-face { |
| 96 | font-family: "Ubuntu"; |
| 97 | src: url("./fonts/Ubuntu-LI.ttf"); |
| 98 | font-weight: 300; |
| 99 | font-style: italic; |
| 100 | } |
| 101 | @font-face { |
| 102 | font-family: "Ubuntu"; |
| 103 | src: url("./fonts/Ubuntu-R.ttf"); |
| 104 | font-weight: 400; |
| 105 | font-style: normal; |
| 106 | } |
| 107 | @font-face { |
| 108 | font-family: "Ubuntu"; |
| 109 | src: url("./fonts/Ubuntu-RI.ttf"); |
| 110 | font-weight: 400; |
| 111 | font-style: italic; |
| 112 | } |
| 113 | @font-face { |
| 114 | font-family: "Ubuntu"; |
| 115 | src: url("./fonts/Ubuntu-M.ttf"); |
| 116 | font-weight: 500; |
| 117 | font-style: normal; |
| 118 | } |
| 119 | @font-face { |
| 120 | font-family: "Ubuntu"; |
| 121 | src: url("./fonts/Ubuntu-MI.ttf"); |
| 122 | font-weight: 500; |
| 123 | font-style: italic; |
| 124 | } |
| 125 | @font-face { |
| 126 | font-family: "Ubuntu"; |
| 127 | src: url("./fonts/Ubuntu-B.ttf"); |
| 128 | font-weight: 700; |
| 129 | font-style: normal; |
| 130 | } |
| 131 | @font-face { |
| 132 | font-family: "Ubuntu"; |
| 133 | src: url("./fonts/Ubuntu-BI.ttf"); |
| 134 | font-weight: 700; |
| 135 | font-style: italic; |
| 136 | } |
| 137 | `, |
| 138 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 139 | }, |
| 140 | }); |
idillon | 760b7fb | 2022-08-29 14:32:38 -0400 | [diff] [blame] | 141 | |
| 142 | export default createTheme(theme, { |
| 143 | components: { |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 144 | MuiButton: { |
| 145 | styleOverrides: { |
| 146 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 147 | height: '46px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 148 | fontWeight: 700, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 149 | fontSize: '15px', |
| 150 | lineHeight: '17px', |
| 151 | textTransform: 'none', |
| 152 | borderRadius: '5px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 153 | }, |
| 154 | sizeSmall: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 155 | height: '36px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 156 | }, |
| 157 | contained: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 158 | background: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 159 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 160 | background: theme.palette.primary.main, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 161 | }, |
| 162 | }, |
| 163 | outlined: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 164 | background: '#FFF', |
| 165 | borderColor: '#0056995C', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 166 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 167 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 168 | background: theme.palette.primary.light, |
| 169 | borderColor: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 170 | }, |
| 171 | }, |
| 172 | text: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 173 | background: '#fff', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 174 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 175 | '&:hover': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 176 | background: theme.palette.primary.light, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 177 | }, |
| 178 | }, |
| 179 | }, |
| 180 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 181 | MuiSwitch: { |
| 182 | defaultProps: { |
| 183 | disableRipple: true, |
| 184 | }, |
| 185 | styleOverrides: { |
| 186 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 187 | width: '60px', |
| 188 | height: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 189 | padding: 0, |
| 190 | }, |
| 191 | switchBase: { |
| 192 | padding: 0, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 193 | '&.Mui-checked': { |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 194 | transform: `translateX(30px)`, |
| 195 | }, |
| 196 | }, |
| 197 | thumb: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 198 | width: '28px', |
| 199 | height: '28px', |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 200 | border: `1px solid ${theme.palette.primary.dark}`, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 201 | '.Mui-checked.Mui-checked &': { |
| 202 | width: '30px', |
| 203 | height: '30px', |
| 204 | border: 'none', |
| 205 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 206 | }, |
| 207 | track: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 208 | backgroundColor: theme.palette.primary.light, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 209 | borderRadius: '30px', |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 210 | opacity: 1, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 211 | '.Mui-checked.Mui-checked + &': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 212 | backgroundColor: theme.palette.primary.light, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 213 | opacity: 1, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 214 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 215 | }, |
| 216 | colorPrimary: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 217 | color: '#fff', |
| 218 | '&.Mui-checked': { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 219 | color: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 220 | }, |
| 221 | }, |
| 222 | }, |
| 223 | }, |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 224 | MuiInput: { |
| 225 | styleOverrides: { |
| 226 | root: { |
| 227 | color: theme.palette.primary.dark, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 228 | '&.Mui-error': { |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 229 | color: theme.palette.error.main, |
| 230 | }, |
| 231 | }, |
| 232 | underline: { |
| 233 | /* |
| 234 | Material UI uses "before" for the regular underline. |
| 235 | There is a second underline called "after" placed over "before" |
| 236 | */ |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 237 | '&:before': { |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 238 | borderBottom: `2px solid ${theme.palette.primary.dark}`, |
| 239 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 240 | '&:hover:not(.Mui-disabled, .Mui-error):before': { |
| 241 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 242 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 243 | '&:after': { |
| 244 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 245 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 246 | '&:hover:not(.Mui-error):after': { |
| 247 | borderBottom: '2px solid #03B9E9', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 248 | }, |
| 249 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 250 | }, |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 251 | }, |
| 252 | MuiFormControl: { |
| 253 | styleOverrides: { |
| 254 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 255 | height: '90px', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 256 | }, |
| 257 | }, |
| 258 | }, |
| 259 | MuiFormHelperText: { |
| 260 | styleOverrides: { |
| 261 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 262 | position: 'absolute', |
| 263 | bottom: '0px', |
| 264 | fontSize: '15px', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 265 | }, |
| 266 | }, |
| 267 | }, |
| 268 | MuiInputLabel: { |
| 269 | styleOverrides: { |
| 270 | root: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 271 | color: 'black', |
| 272 | fontSize: '15px', |
| 273 | left: '50%', |
| 274 | transform: 'translate(-50%, 20px)', |
| 275 | transition: 'left .2s, transform .2s', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 276 | }, |
| 277 | shrink: { |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 278 | color: 'black', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 279 | left: 0, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 280 | transform: 'translate(0, 50px) scale(0.75)', |
| 281 | transition: 'left .2s, transform .2s', |
| 282 | '&.Mui-focused, &.Mui-error': { |
| 283 | color: 'black', |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 284 | }, |
| 285 | }, |
| 286 | }, |
| 287 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 288 | }, |
simon | d47ef9e | 2022-09-28 22:24:28 -0400 | [diff] [blame] | 289 | }); |