/
theme.js
70 lines (58 loc) · 1.61 KB
/
theme.js
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
58
59
60
61
62
63
64
65
66
67
68
69
70
export const colors = {
white: 'rgb(255, 255, 255)',
grayDark: 'rgb(54, 54, 54)',
gray: 'rgb(204, 204, 204)',
grayLight: 'rgb(187, 187, 187)',
grayLightest: 'rgb(219, 219, 219)',
primary: 'rgb(0, 188, 212)',
error: 'rgb(245, 0, 87)',
disabled: 'rgb(245, 245, 245)',
shadow: 'rgba(0, 0, 0, 0.04)',
};
export const theme = {
// typography
fontSize: '1rem',
color: colors.grayDark,
error: colors.error,
disabled: colors.gray,
// background
background: colors.white,
backgroundEnter: colors.white,
backgroundFocus: colors.white,
backgroundDisabled: colors.disabled,
backgroundError: colors.white,
// border
borderWidth: '1px',
borderRadius: '3px',
borderColor: colors.grayLightest,
borderColorEnter: colors.gray,
borderColorFocus: colors.primary,
borderColorDisabled: colors.disabled,
borderColorError: colors.error,
// box-shadow
boxShadow: '0 0 0 transparent',
boxShadowEnter: `0 2px 2px ${colors.shadow} inset`,
boxShadowDisabled: `0 2px 2px ${colors.shadow} inset`,
// transition
transitionProperty: 'color, box-shadow, border',
transitionDuration: '110ms',
transitionTimingFunction: 'cubic-bezier(.25, .46, .45, .94)', // ease-out-quad
// control
controlHeight: '2.7em',
// select
selectArrowColor: colors.primary,
// spinner
spinnerColor: colors.primary,
spinnerDuration: '500ms',
};
export const extendTheme = (extendsTheme = {}) => ({
...theme,
...extendsTheme,
});
export const themeProps = {
theme: {
rdf: theme,
},
};
export const get = (props, key) => props.theme.rdf[key];
export const bind = key => props => get(props, key);