refs #14565-login
[arvados.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             selected: {
75                 fontWeight: 700,
76                 color: arvadosPurple
77             }
78         },
79         MuiList: {
80             root: {
81                 color: grey900
82             }
83         },
84         MuiListItemText: {
85             root: {
86                 padding: 0
87             }
88         },
89         MuiListItemIcon: {
90             root: {
91                 fontSize: '1.25rem'
92             }
93         },
94         MuiCardHeader: {
95             avatar: {
96                 display: 'flex',
97                 alignItems: 'center'
98             },
99             title: {
100                 color: grey700,
101                 fontSize: '1.25rem'
102             }
103         },
104         MuiMenuItem: {
105             root: {
106                 padding: '8px 16px'
107             }
108         },
109         MuiInput: {
110             root: {
111                 fontSize: '0.875rem'
112             },
113             underline: {
114                 '&:after': {
115                     borderBottomColor: arvadosPurple
116                 },
117                 '&:hover:not($disabled):not($focused):not($error):before': {
118                     borderBottom: '1px solid inherit'
119                 }
120             }
121         },
122         MuiFormLabel: {
123             root: {
124                 fontSize: '0.875rem'
125             },
126             focused: {
127                 "&$focused:not($error)": {
128                     color: arvadosPurple
129                 }
130             }
131         },
132         MuiStepIcon: {
133             root: {
134                 '&$active': {
135                     color: arvadosPurple
136                 },
137                 '&$completed': {
138                     color: 'inherited'
139                 },
140             }
141         }
142     },
143     mixins: {
144         toolbar: {
145             minHeight: '48px'
146         }
147     },
148     palette: {
149         primary: {
150             main: teal.A700,
151             dark: teal.A400,
152             contrastText: '#fff'
153         }
154     },
155 };
156
157 export const CustomTheme = createMuiTheme(themeOptions);