-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTheme.tsx
57 lines (44 loc) · 1.23 KB
/
Theme.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* This file defines the main theme of the application and connects the
* theme to all styled-components instances. The application layout is
* specified in style.css
*/
import * as React from 'react';
import { theme } from 'SRC/constants';
import { createGlobalStyle, ThemeProvider } from 'SRC/utils/styled-components';
const GlobalStylesheet = createGlobalStyle`
@import url('https://fonts.googleapis.com/css?family=Open+Sans');
* {
box-sizing: border-box;
}
body {
margin: 0;
overflow: hidden;
user-select: none;
color: ${(props) => props.theme.colors.fg};
font-family: 'Open Sans', sans-serif;
font-size: 14px;
}
a {
text-decoration: none;
}
#root > div {
border-color: ${(props) => props.theme.colors.border} !important;
}
#main {
background: ${(props) => props.theme.colors.panel};
}
`;
/**
* Adds application theme to the React tree
*/
export const Theme = (props: { children: React.ReactNode | React.ReactNodeArray }) => {
return (
<ThemeProvider theme={theme}>
<>
<GlobalStylesheet />
{props.children}
</>
</ThemeProvider>
);
};