-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy paththeme.ts
executable file
·170 lines (168 loc) · 6.16 KB
/
theme.ts
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
import { readableColor, transparentize } from 'polished';
import saturnTheme from './grommet-theme.json';
export const theme = {
spacing: {
unit: 5,
sectionHorizontal: ({ spacing }) => spacing.unit * 8,
sectionVertical: ({ spacing }) => spacing.unit * 8,
},
breakpoints: {
xs: `${saturnTheme.global.breakpoints.small.value}px`,
small: `${saturnTheme.global.breakpoints.small.value}px`,
medium: `${saturnTheme.global.breakpoints.small.value}px`,
large: `${saturnTheme.global.breakpoints.medium.value}px`,
},
colors: {
tonalOffset: 0.2,
primary: {
main: saturnTheme.global.colors['green!'],
contrastText: saturnTheme.global.colors['background-front'].dark,
},
success: {
main: saturnTheme.global.colors['status-ok'].light,
light: saturnTheme.global.colors['status-ok'].light,
dark: saturnTheme.global.colors['status-ok'].dark,
contrastText: ({ colors }) => readableColor(colors.success.main),
},
error: {
main: saturnTheme.global.colors['status-error'].light,
light: saturnTheme.global.colors['status-error'].light,
dark: saturnTheme.global.colors['status-error'].dark,
contrastText: ({ colors }) => readableColor(colors.error.main),
},
warning: {
main: saturnTheme.global.colors['status-warning'].light,
light: saturnTheme.global.colors['status-warning'].light,
dark: saturnTheme.global.colors['status-warning'].dark,
contrastText: ({ colors }) => readableColor(colors.warning.main),
},
info: {
main: saturnTheme.global.colors['status-unknown'].light,
light: saturnTheme.global.colors['status-unknown'].light,
dark: saturnTheme.global.colors['status-unknown'].dark,
contrastText: ({ colors }) => readableColor(colors.info.main),
},
text: {
primary: saturnTheme.global.colors.text.light,
},
border: {
dark: saturnTheme.global.colors.border.dark,
light: saturnTheme.global.colors.border.light,
},
responses: {
success: {
color: ({ colors }) => colors.success.main,
backgroundColor: ({ colors }) => transparentize(0.9, colors.success.main),
},
error: {
color: ({ colors }) => colors.error.main,
backgroundColor: ({ colors }) => transparentize(0.9, colors.error.main),
},
redirect: {
color: ({ colors }) => colors.warning.main,
backgroundColor: ({ colors }) => transparentize(0.9, colors.responses.redirect.color),
},
info: {
color: ({ colors }) => colors.info.main,
backgroundColor: ({ colors }) => transparentize(0.9, colors.responses.info.color),
},
},
http: {
get: saturnTheme.global.colors['green!'],
post: saturnTheme.global.colors['yellow!'],
put: saturnTheme.global.colors['orange!'],
options: saturnTheme.global.colors['purple!'],
patch: saturnTheme.global.colors['teal!'],
delete: saturnTheme.global.colors['red!'],
basic: '#999',
link: saturnTheme.global.colors['blue!'],
head: saturnTheme.global.colors['blue!'],
},
},
sidebar: {
backgroundColor: '#fafafa',
width: '320px',
spacing: {
paddingVertical: 8,
offsetNesting: 6,
}
},
typography: {
fontSize: '18px',
lineHeight: '1.45em',
fontWeightRegular: '400',
fontWeightBold: '600',
fontWeightLight: '300',
fontFamily: 'Metric, Arial, sans-serif',
headings: {
fontFamily: saturnTheme.global.font.family,
fontWeight: '600',
lineHeight: ({ typography }) => typography.lineHeight,
},
heading1: {
fontSize: saturnTheme.heading.level[1].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
color: ({ colors }) => colors.text.primary,
capitalize: false,
},
heading2: {
fontSize: saturnTheme.heading.level[2].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
color: ({ colors }) => colors.text.primary,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
capitalize: false,
},
heading3: {
fontSize: saturnTheme.heading.level[3].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
color: ({ colors }) => colors.text.primary,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
capitalize: false,
},
heading4: {
fontSize: saturnTheme.heading.level[4].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
color: ({ colors }) => colors.text.primary,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
capitalize: false,
},
heading5: {
fontSize: saturnTheme.heading.level[5].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
color: ({ colors }) => colors.text.primary,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
capitalize: false,
},
heading6: {
fontSize: saturnTheme.heading.level[6].medium.size,
fontWeight: ({ typography }) => typography.headings.fontWeight,
color: ({ colors }) => colors.text.primary,
fontFamily: ({ typography }) => typography.headings.fontFamily,
lineHeight: ({ typography }) => typography.headings.lineHeight,
capitalize: false,
},
code: {
fontSize: '14px',
fontFamily: 'Courier, monospace',
fontWeight: ({ typography }) => typography.fontWeightRegular,
color: '#e53935',
backgroundColor: 'rgba(38, 50, 56, 0.04)',
wrap: false,
},
links: {
color: ({ colors }) => colors.primary.main,
hover: ({ colors }) => colors.text.primary,
fontWeight: '500',
},
},
rightPanel: {
width: '40%',
textColor: ({ colors }) => colors.text.primary,
},
};