refs #master Merge branch 'origin/master' into 13856-upload-component
[arvados-workbench2.git] / src / common / custom-theme.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { createMuiTheme } from '@material-ui/core/styles';
6 import { ThemeOptions, Theme } from '@material-ui/core/styles/createMuiTheme';
7 import purple from '@material-ui/core/colors/purple';
8 import blue from '@material-ui/core/colors/blue';
9 import grey from '@material-ui/core/colors/grey';
10 import green from '@material-ui/core/colors/green';
11 import yellow from '@material-ui/core/colors/yellow';
12 import red from '@material-ui/core/colors/red';
13
14 interface ArvadosThemeOptions extends ThemeOptions {
15     customs: any;
16 }
17
18 export interface ArvadosTheme extends Theme {
19     customs: {
20         colors: Colors
21     };
22 }
23
24 interface Colors {
25     green700: string;
26     yellow700: string;
27 }
28
29 const red900 = red["900"];
30 const purple800 = purple["800"];
31 const grey200 = grey["200"];
32 const grey300 = grey["300"];
33 const grey500 = grey["500"];
34 const grey600 = grey["600"];
35 const grey700 = grey["700"];
36 const grey900 = grey["900"];
37
38 const themeOptions: ArvadosThemeOptions = {
39     customs: {
40         colors: {
41             green700: green["700"],
42             yellow700: yellow["700"]
43         }
44     },
45     overrides: {
46         MuiTypography: {
47             body1: {
48                 fontSize: '0.8125rem'
49             }
50         },
51         MuiAppBar: {
52             colorPrimary: {
53                 backgroundColor: purple800
54             }
55         },
56         MuiTabs: {
57             root: {
58                 color: grey600
59             },
60             indicator: {
61                 backgroundColor: purple800
62             }
63         },
64         MuiTab: {
65             selected: {
66                 fontWeight: 700,
67                 color: purple800
68             }
69         },
70         MuiList: {
71             root: {
72                 color: grey900
73             }
74         },
75         MuiListItemText: {
76             root: {
77                 padding: 0
78             }
79         },
80         MuiListItemIcon: {
81             root: {
82                 fontSize: '1.25rem'
83             }
84         },
85         MuiCardHeader: {
86             avatar: {
87                 display: 'flex',
88                 alignItems: 'center'
89             },
90             title: {
91                 color: grey700,
92                 fontSize: '1.25rem'
93             }
94         },
95         MuiMenuItem: {
96             root: {
97                 padding: '8px 16px'
98             }
99         },
100         MuiInput: {
101             underline: {
102                 '&:after': {
103                     borderBottomColor: purple800
104                 },
105                 '&:hover:not($disabled):not($focused):not($error):before': {
106                     borderBottom: '1px solid inherit'
107                 }
108             }
109         },
110         MuiFormLabel: {
111             focused: {
112                 "&$focused:not($error)": {
113                     color: purple800
114                 }
115             }
116         }
117     },
118     mixins: {
119         toolbar: {
120             minHeight: '48px'
121         }
122     },
123     palette: {
124         primary: {
125             main: '#06C',
126             dark: blue.A100
127         }
128     }
129 };
130
131 export const CustomTheme = createMuiTheme(themeOptions);