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