Merge branch 'master' into 15672-subprocess-list-v2
[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 import teal from '@material-ui/core/colors/teal';
14
15 export interface ArvadosThemeOptions extends ThemeOptions {
16     customs: any;
17 }
18
19 export interface ArvadosTheme extends Theme {
20     customs: {
21         colors: Colors
22     };
23 }
24
25 interface Colors {
26     green700: string;
27     yellow700: string;
28     red900: string;
29     blue500: string;
30     purple: string;
31 }
32
33 const arvadosPurple = '#361336';
34 const purple800 = purple["800"];
35 const grey500 = grey["500"];
36 const grey600 = grey["600"];
37 const grey700 = grey["700"];
38 const grey900 = grey["900"];
39 const rocheBlue = '#06C';
40
41 export const themeOptions: ArvadosThemeOptions = {
42     typography: {
43         useNextVariants: true,
44     },
45     customs: {
46         colors: {
47             green700: green["700"],
48             yellow700: yellow["700"],
49             red900: red['900'],
50             blue500: blue['500'],
51             purple: arvadosPurple
52         }
53     },
54     overrides: {
55         MuiTypography: {
56             body1: {
57                 fontSize: '0.8125rem'
58             }
59         },
60         MuiAppBar: {
61             colorPrimary: {
62                 backgroundColor: arvadosPurple
63             }
64         },
65         MuiTabs: {
66             root: {
67                 color: grey600
68             },
69             indicator: {
70                 backgroundColor: arvadosPurple
71             }
72         },
73         MuiTab: {
74             root: {
75                 '&$selected': {
76                     fontWeight: 700,
77                     color: arvadosPurple
78                 }
79             }
80         },
81         MuiList: {
82             root: {
83                 color: grey900
84             }
85         },
86         MuiListItemText: {
87             root: {
88                 padding: 0
89             }
90         },
91         MuiListItemIcon: {
92             root: {
93                 fontSize: '1.25rem'
94             }
95         },
96         MuiCardHeader: {
97             avatar: {
98                 display: 'flex',
99                 alignItems: 'center'
100             },
101             title: {
102                 color: grey700,
103                 fontSize: '1.25rem'
104             }
105         },
106         MuiMenuItem: {
107             root: {
108                 padding: '8px 16px'
109             }
110         },
111         MuiInput: {
112             root: {
113                 fontSize: '0.875rem'
114             },
115             underline: {
116                 '&:after': {
117                     borderBottomColor: arvadosPurple
118                 },
119                 '&:hover:not($disabled):not($focused):not($error):before': {
120                     borderBottom: '1px solid inherit'
121                 }
122             }
123         },
124         MuiFormLabel: {
125             root: {
126                 fontSize: '0.875rem',
127                 "&$focused": {
128                     "&$focused:not($error)": {
129                         color: arvadosPurple
130                     }
131                 }
132             }
133         },
134         MuiStepIcon: {
135             root: {
136                 '&$active': {
137                     color: arvadosPurple
138                 },
139                 '&$completed': {
140                     color: 'inherited'
141                 },
142             }
143         }
144     },
145     mixins: {
146         toolbar: {
147             minHeight: '48px'
148         }
149     },
150     palette: {
151         primary: {
152             main: teal.A700,
153             dark: teal.A400,
154             contrastText: '#fff'
155         }
156     },
157 };
158
159 export const CustomTheme = createMuiTheme(themeOptions);