idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 1 | import { createTheme } from "@mui/material"; |
| 2 | |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 3 | const theme = createTheme({ |
| 4 | palette: { |
| 5 | primary: { |
| 6 | light: "#E5EEF5", // same as "#0056991A" |
| 7 | main: "#0071C9", |
| 8 | dark: "#005699", |
| 9 | }, |
| 10 | error: { |
| 11 | main: "#CC0022", |
| 12 | }, |
| 13 | success: { |
| 14 | main: "#009980", |
| 15 | }, |
| 16 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 17 | typography: { |
| 18 | fontFamily: "Ubuntu", |
idillon | 24fe8d8 | 2022-08-29 16:55:20 -0400 | [diff] [blame] | 19 | allVariants: { |
| 20 | color: "black" |
| 21 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 22 | h1: { |
| 23 | fontWeight: 400, |
| 24 | fontSize: "26px", |
| 25 | lineHeight: "36px", |
| 26 | }, |
| 27 | h2: { |
| 28 | fontWeight: 400, |
| 29 | fontSize: "22px", |
| 30 | lineHeight: "30px", |
| 31 | }, |
| 32 | h3: { |
| 33 | fontWeight: 400, |
| 34 | fontSize: "18px", |
| 35 | lineHeight: "26px", |
| 36 | }, |
| 37 | h4: { |
| 38 | fontWeight: 500, |
| 39 | fontSize: "15px", |
| 40 | lineHeight: "22px", |
| 41 | }, |
| 42 | h5: { |
| 43 | fontWeight: 500, |
| 44 | fontSize: "13px", |
| 45 | lineHeight: "19px", |
| 46 | }, |
| 47 | body1: { |
| 48 | fontWeight: 400, |
| 49 | fontSize: "15px", |
| 50 | lineHeight: "22px" |
| 51 | }, |
| 52 | body2: { |
| 53 | fontWeight: 400, |
| 54 | fontSize: "13px", |
| 55 | lineHeight: "19px", |
| 56 | }, |
| 57 | caption: { |
| 58 | fontWeight: 400, |
| 59 | fontSize: "12px", |
| 60 | lineHeight: "16px", |
| 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 | }, |
| 122 | } |
| 123 | }) |
| 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: { |
| 130 | height: "46px", |
| 131 | fontWeight: 700, |
| 132 | fontSize: "15px", |
| 133 | lineHeight: "17px", |
| 134 | textTransform: "none", |
idillon-sfl | 37c18df | 2022-08-26 18:44:27 -0400 | [diff] [blame] | 135 | borderRadius: "5px", |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 136 | }, |
| 137 | sizeSmall: { |
| 138 | height: "36px", |
| 139 | }, |
| 140 | contained: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 141 | background: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -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: { |
| 147 | background: "#FFF", |
| 148 | borderColor: "#0056995C", |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 149 | color: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -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: { |
| 156 | background: "#fff", |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 157 | color: theme.palette.primary.dark, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -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: { |
| 170 | width: "60px", |
| 171 | height: "30px", |
| 172 | padding: 0, |
| 173 | }, |
| 174 | switchBase: { |
| 175 | padding: 0, |
| 176 | "&.Mui-checked": { |
| 177 | transform: `translateX(30px)`, |
| 178 | }, |
| 179 | }, |
| 180 | thumb: { |
| 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}`, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 184 | ".Mui-checked.Mui-checked &": { |
| 185 | width: "30px", |
| 186 | height: "30px", |
| 187 | border: "none", |
| 188 | } |
| 189 | }, |
| 190 | track: { |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 191 | backgroundColor: theme.palette.primary.light, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 192 | borderRadius: "30px", |
| 193 | opacity: 1, |
| 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, |
| 197 | } |
| 198 | }, |
| 199 | colorPrimary: { |
| 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, |
| 211 | "&.Mui-error": { |
| 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 | */ |
| 220 | "&:before": { |
| 221 | borderBottom: `2px solid ${theme.palette.primary.dark}`, |
| 222 | }, |
| 223 | "&:hover:not(.Mui-disabled, .Mui-error):before": { |
| 224 | borderBottom: "2px solid #03B9E9", |
| 225 | }, |
| 226 | "&:after": { |
| 227 | borderBottom: "2px solid #03B9E9", |
| 228 | }, |
| 229 | "&:hover:not(.Mui-error):after": { |
| 230 | borderBottom: "2px solid #03B9E9", |
| 231 | }, |
| 232 | }, |
| 233 | } |
| 234 | }, |
| 235 | MuiFormControl: { |
| 236 | styleOverrides: { |
| 237 | root: { |
| 238 | height: "90px", |
| 239 | }, |
| 240 | }, |
| 241 | }, |
| 242 | MuiFormHelperText: { |
| 243 | styleOverrides: { |
| 244 | root: { |
| 245 | position: "absolute", |
| 246 | bottom: "0px", |
| 247 | fontSize: "15px", |
| 248 | }, |
| 249 | }, |
| 250 | }, |
| 251 | MuiInputLabel: { |
| 252 | styleOverrides: { |
| 253 | root: { |
| 254 | color: "black", |
| 255 | fontSize: "15px", |
| 256 | left: "50%", |
| 257 | transform: "translate(-50%, 20px)", |
| 258 | transition: "left .2s, transform .2s", |
| 259 | }, |
| 260 | shrink: { |
| 261 | color: "black", |
| 262 | left: 0, |
| 263 | transform: "translate(0, 50px) scale(0.75)", |
| 264 | transition: "left .2s, transform .2s", |
| 265 | "&.Mui-focused, &.Mui-error": { |
| 266 | color: "black", |
| 267 | }, |
| 268 | }, |
| 269 | }, |
| 270 | }, |
idillon-sfl | 837ea0b | 2022-08-25 11:35:29 -0400 | [diff] [blame] | 271 | }, |
idillon-sfl | deabd28 | 2022-08-25 22:50:03 -0400 | [diff] [blame] | 272 | }) |