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