blob: 3ba20ab7de40e339db5262ceba97d3ae36e6dabf [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 */
simond47ef9e2022-09-28 22:24:28 -040018import { createTheme } from '@mui/material';
idillon-sfl837ea0b2022-08-25 11:35:29 -040019
idillon-sfldeabd282022-08-25 22:50:03 -040020const theme = createTheme({
21 palette: {
22 primary: {
simond47ef9e2022-09-28 22:24:28 -040023 light: '#E5EEF5', // same as "#0056991A"
24 main: '#0071C9',
25 dark: '#005699',
idillon-sfldeabd282022-08-25 22:50:03 -040026 },
27 error: {
simond47ef9e2022-09-28 22:24:28 -040028 main: '#CC0022',
idillon-sfldeabd282022-08-25 22:50:03 -040029 },
30 success: {
simond47ef9e2022-09-28 22:24:28 -040031 main: '#009980',
idillon-sfldeabd282022-08-25 22:50:03 -040032 },
33 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040034 typography: {
simond47ef9e2022-09-28 22:24:28 -040035 fontFamily: 'Ubuntu',
idillon24fe8d82022-08-29 16:55:20 -040036 allVariants: {
simond47ef9e2022-09-28 22:24:28 -040037 color: 'black',
idillon24fe8d82022-08-29 16:55:20 -040038 },
idillon-sfl837ea0b2022-08-25 11:35:29 -040039 h1: {
40 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040041 fontSize: '26px',
42 lineHeight: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040043 },
44 h2: {
45 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040046 fontSize: '22px',
47 lineHeight: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040048 },
49 h3: {
50 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040051 fontSize: '18px',
52 lineHeight: '26px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040053 },
54 h4: {
55 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040056 fontSize: '15px',
57 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040058 },
59 h5: {
60 fontWeight: 500,
simond47ef9e2022-09-28 22:24:28 -040061 fontSize: '13px',
62 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040063 },
64 body1: {
65 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040066 fontSize: '15px',
67 lineHeight: '22px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040068 },
69 body2: {
70 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040071 fontSize: '13px',
72 lineHeight: '19px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040073 },
74 caption: {
75 fontWeight: 400,
simond47ef9e2022-09-28 22:24:28 -040076 fontSize: '12px',
77 lineHeight: '16px',
idillon-sfl837ea0b2022-08-25 11:35:29 -040078 },
79 },
80 components: {
idillon760b7fb2022-08-29 14:32:38 -040081 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 },
simond47ef9e2022-09-28 22:24:28 -0400139 },
140});
idillon760b7fb2022-08-29 14:32:38 -0400141
142export default createTheme(theme, {
143 components: {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400144 MuiButton: {
145 styleOverrides: {
146 root: {
simond47ef9e2022-09-28 22:24:28 -0400147 height: '46px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400148 fontWeight: 700,
simond47ef9e2022-09-28 22:24:28 -0400149 fontSize: '15px',
150 lineHeight: '17px',
151 textTransform: 'none',
152 borderRadius: '5px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400153 },
154 sizeSmall: {
simond47ef9e2022-09-28 22:24:28 -0400155 height: '36px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400156 },
157 contained: {
idillon-sfldeabd282022-08-25 22:50:03 -0400158 background: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400159 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400160 background: theme.palette.primary.main,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400161 },
162 },
163 outlined: {
simond47ef9e2022-09-28 22:24:28 -0400164 background: '#FFF',
165 borderColor: '#0056995C',
idillon-sfldeabd282022-08-25 22:50:03 -0400166 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400167 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400168 background: theme.palette.primary.light,
169 borderColor: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400170 },
171 },
172 text: {
simond47ef9e2022-09-28 22:24:28 -0400173 background: '#fff',
idillon-sfldeabd282022-08-25 22:50:03 -0400174 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400175 '&:hover': {
idillon-sfldeabd282022-08-25 22:50:03 -0400176 background: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400177 },
178 },
179 },
180 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400181 MuiSwitch: {
182 defaultProps: {
183 disableRipple: true,
184 },
185 styleOverrides: {
186 root: {
simond47ef9e2022-09-28 22:24:28 -0400187 width: '60px',
188 height: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400189 padding: 0,
190 },
191 switchBase: {
192 padding: 0,
simond47ef9e2022-09-28 22:24:28 -0400193 '&.Mui-checked': {
idillon-sfl837ea0b2022-08-25 11:35:29 -0400194 transform: `translateX(30px)`,
195 },
196 },
197 thumb: {
simond47ef9e2022-09-28 22:24:28 -0400198 width: '28px',
199 height: '28px',
idillon-sfldeabd282022-08-25 22:50:03 -0400200 border: `1px solid ${theme.palette.primary.dark}`,
simond47ef9e2022-09-28 22:24:28 -0400201 '.Mui-checked.Mui-checked &': {
202 width: '30px',
203 height: '30px',
204 border: 'none',
205 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400206 },
207 track: {
idillon-sfldeabd282022-08-25 22:50:03 -0400208 backgroundColor: theme.palette.primary.light,
simond47ef9e2022-09-28 22:24:28 -0400209 borderRadius: '30px',
idillon-sfl837ea0b2022-08-25 11:35:29 -0400210 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400211 '.Mui-checked.Mui-checked + &': {
idillon-sfldeabd282022-08-25 22:50:03 -0400212 backgroundColor: theme.palette.primary.light,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400213 opacity: 1,
simond47ef9e2022-09-28 22:24:28 -0400214 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400215 },
216 colorPrimary: {
simond47ef9e2022-09-28 22:24:28 -0400217 color: '#fff',
218 '&.Mui-checked': {
idillon-sfldeabd282022-08-25 22:50:03 -0400219 color: theme.palette.primary.dark,
idillon-sfl837ea0b2022-08-25 11:35:29 -0400220 },
221 },
222 },
223 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400224 MuiInput: {
225 styleOverrides: {
226 root: {
227 color: theme.palette.primary.dark,
simond47ef9e2022-09-28 22:24:28 -0400228 '&.Mui-error': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400229 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 */
simond47ef9e2022-09-28 22:24:28 -0400237 '&:before': {
idillon-sfl37c18df2022-08-26 18:44:27 -0400238 borderBottom: `2px solid ${theme.palette.primary.dark}`,
239 },
simond47ef9e2022-09-28 22:24:28 -0400240 '&:hover:not(.Mui-disabled, .Mui-error):before': {
241 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400242 },
simond47ef9e2022-09-28 22:24:28 -0400243 '&:after': {
244 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400245 },
simond47ef9e2022-09-28 22:24:28 -0400246 '&:hover:not(.Mui-error):after': {
247 borderBottom: '2px solid #03B9E9',
idillon-sfl37c18df2022-08-26 18:44:27 -0400248 },
249 },
simond47ef9e2022-09-28 22:24:28 -0400250 },
idillon-sfl37c18df2022-08-26 18:44:27 -0400251 },
252 MuiFormControl: {
253 styleOverrides: {
254 root: {
simond47ef9e2022-09-28 22:24:28 -0400255 height: '90px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400256 },
257 },
258 },
259 MuiFormHelperText: {
260 styleOverrides: {
261 root: {
simond47ef9e2022-09-28 22:24:28 -0400262 position: 'absolute',
263 bottom: '0px',
264 fontSize: '15px',
idillon-sfl37c18df2022-08-26 18:44:27 -0400265 },
266 },
267 },
268 MuiInputLabel: {
269 styleOverrides: {
270 root: {
simond47ef9e2022-09-28 22:24:28 -0400271 color: 'black',
272 fontSize: '15px',
273 left: '50%',
274 transform: 'translate(-50%, 20px)',
275 transition: 'left .2s, transform .2s',
idillon-sfl37c18df2022-08-26 18:44:27 -0400276 },
277 shrink: {
simond47ef9e2022-09-28 22:24:28 -0400278 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400279 left: 0,
simond47ef9e2022-09-28 22:24:28 -0400280 transform: 'translate(0, 50px) scale(0.75)',
281 transition: 'left .2s, transform .2s',
282 '&.Mui-focused, &.Mui-error': {
283 color: 'black',
idillon-sfl37c18df2022-08-26 18:44:27 -0400284 },
285 },
286 },
287 },
idillon-sfl837ea0b2022-08-25 11:35:29 -0400288 },
simond47ef9e2022-09-28 22:24:28 -0400289});