aboutsummaryrefslogtreecommitdiffstats
path: root/packages/theme/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/theme/src')
-rw-r--r--packages/theme/src/index.ts18
-rw-r--r--packages/theme/src/themes/dark/index.ts120
-rw-r--r--packages/theme/src/themes/default/index.ts209
-rw-r--r--packages/theme/src/themes/legacy/index.ts38
4 files changed, 385 insertions, 0 deletions
diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts
new file mode 100644
index 000000000..524a9edf1
--- /dev/null
+++ b/packages/theme/src/index.ts
@@ -0,0 +1,18 @@
1import * as darkThemeConfig from './themes/dark';
2import * as defaultThemeConfig from './themes/default';
3import * as legacyStyles from './themes/legacy';
4
5export enum ThemeType {
6 default = 'default',
7 dark = 'dark',
8}
9
10export function theme(themeId: ThemeType) {
11 if (themeId === ThemeType.dark) {
12 return Object.assign({}, defaultThemeConfig, darkThemeConfig, { legacyStyles });
13 }
14
15 return Object.assign({}, defaultThemeConfig, { legacyStyles });
16}
17
18export type Theme = typeof defaultThemeConfig;
diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts
new file mode 100644
index 000000000..d48dbf916
--- /dev/null
+++ b/packages/theme/src/themes/dark/index.ts
@@ -0,0 +1,120 @@
1import color from 'color';
2import { cloneDeep, merge } from 'lodash';
3
4import * as defaultStyles from '../default';
5import * as legacyStyles from '../legacy';
6
7export const colorBackground = legacyStyles.darkThemeGrayDarkest;
8export const colorContentBackground = legacyStyles.darkThemeGrayDarkest;
9export const colorBackgroundSubscriptionContainer = legacyStyles.themeBrandInfo;
10
11export const colorHeadline = legacyStyles.darkThemeTextColor;
12export const colorText = legacyStyles.darkThemeTextColor;
13
14// Loader
15export const colorFullscreenLoaderSpinner = '#FFF';
16export const colorWebviewLoaderBackground = color(legacyStyles.darkThemeGrayDarkest).alpha(0.5).rgb().string();
17
18// Input
19export const labelColor = legacyStyles.darkThemeTextColor;
20export const inputColor = legacyStyles.darkThemeGrayLightest;
21export const inputBackground = legacyStyles.themeGrayDark;
22export const inputBorder = `1px solid ${legacyStyles.darkThemeGrayLight}`;
23export const inputPrefixColor = color(legacyStyles.darkThemeGrayLighter).lighten(0.3).hex();
24export const inputPrefixBackground = legacyStyles.darkThemeGray;
25export const inputDisabledOpacity = 0.5;
26export const inputScorePasswordBackground = legacyStyles.darkThemeGrayDark;
27export const inputModifierColor = color(legacyStyles.darkThemeGrayLighter).lighten(0.3).hex();
28export const inputPlaceholderColor = color(legacyStyles.darkThemeGrayLighter).darken(0.1).hex();
29
30// Toggle
31export const toggleBackground = legacyStyles.darkThemeGray;
32export const toggleButton = legacyStyles.darkThemeGrayLighter;
33
34// Button
35export const buttonPrimaryTextColor = legacyStyles.darkThemeTextColor;
36
37export const buttonSecondaryBackground = legacyStyles.darkThemeGrayLighter;
38export const buttonSecondaryTextColor = legacyStyles.darkThemeTextColor;
39
40export const buttonDangerTextColor = legacyStyles.darkThemeTextColor;
41
42export const buttonWarningTextColor = legacyStyles.darkThemeTextColor;
43
44export const buttonLoaderColor = {
45 primary: '#FFF',
46 secondary: buttonSecondaryTextColor,
47 success: '#FFF',
48 warning: '#FFF',
49 danger: '#FFF',
50 inverted: defaultStyles.brandPrimary,
51};
52
53// Select
54export const selectBackground = inputBackground;
55export const selectBorder = inputBorder;
56export const selectColor = inputColor;
57export const selectToggleColor = inputPrefixColor;
58export const selectPopupBackground = legacyStyles.darkThemeGrayLight;
59export const selectOptionColor = '#FFF';
60export const selectOptionBorder = `1px solid ${color(legacyStyles.darkThemeGrayLight).darken(0.2).hex()}`;
61export const selectOptionItemHover = color(legacyStyles.darkThemeGrayLight).darken(0.2).hex();
62export const selectOptionItemHoverColor = selectColor;
63export const selectSearchColor = inputBackground;
64
65// Modal
66export const colorModalOverlayBackground = color(legacyStyles.darkThemeBlack).alpha(0.8).rgb().string();
67
68// Services
69export const services = merge({}, defaultStyles.services, {
70 listItems: {
71 borderColor: legacyStyles.darkThemeGrayDarker,
72 hoverBgColor: legacyStyles.darkThemeGrayDarker,
73 disabled: {
74 color: legacyStyles.darkThemeGray,
75 },
76 },
77});
78
79// Service Icon
80export const serviceIcon = merge({}, defaultStyles.serviceIcon, {
81 isCustom: {
82 border: `1px solid ${legacyStyles.darkThemeGrayDark}`,
83 },
84});
85
86// Workspaces
87const drawerBg = color(colorBackground).lighten(0.3).hex();
88
89export const workspaces = merge({}, defaultStyles.workspaces, {
90 settings: {
91 listItems: cloneDeep(services.listItems),
92 },
93 drawer: {
94 background: drawerBg,
95 addButton: {
96 color: legacyStyles.darkThemeGrayLighter,
97 hoverColor: legacyStyles.darkThemeGraySmoke,
98 },
99 listItem: {
100 border: color(drawerBg).lighten(0.2).hex(),
101 hoverBackground: color(drawerBg).lighten(0.2).hex(),
102 activeBackground: defaultStyles.brandPrimary,
103 name: {
104 color: colorText,
105 activeColor: 'white',
106 },
107 services: {
108 color: color(colorText).darken(0.5).hex(),
109 active: color(defaultStyles.brandPrimary).lighten(0.5).hex(),
110 },
111 },
112 },
113});
114
115// Announcements
116export const announcements = merge({}, defaultStyles.workspaces, {
117 spotlight: {
118 background: legacyStyles.darkThemeGrayDark,
119 },
120});
diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts
new file mode 100644
index 000000000..0f02fa3c8
--- /dev/null
+++ b/packages/theme/src/themes/default/index.ts
@@ -0,0 +1,209 @@
1import color from 'color';
2import { cloneDeep } from 'lodash';
3
4import * as legacyStyles from '../legacy';
5
6export interface IStyleTypes {
7 [index: string]: {
8 accent: string;
9 contrast: string;
10 border?: string;
11 };
12}
13
14export const brandPrimary = '#3498db';
15export const brandSuccess = '#5cb85c';
16export const brandInfo = '#5bc0de';
17export const brandWarning = '#FF9F00';
18export const brandDanger = '#d9534f';
19
20export const uiFontSize = 14;
21
22export const borderRadius = legacyStyles.themeBorderRadius;
23export const borderRadiusSmall = legacyStyles.themeBorderRadiusSmall;
24
25export const colorBackground = legacyStyles.themeGrayLighter;
26export const colorContentBackground = '#FFFFFF';
27export const colorHeadline = legacyStyles.themeGrayDark;
28
29export const colorText = legacyStyles.themeTextColor;
30
31// Subscription Container Component
32export const colorSubscriptionContainerBackground = 'none';
33export const colorSubscriptionContainerBorder = `1px solid ${brandPrimary}`;
34export const colorSubscriptionContainerTitle = brandPrimary;
35export const colorSubscriptionContainerActionButtonBackground = brandPrimary;
36export const colorSubscriptionContainerActionButtonColor = '#FFF';
37
38// Loader
39export const colorAppLoaderSpinner = '#FFF';
40export const colorFullscreenLoaderSpinner = legacyStyles.themeGrayDark;
41export const colorWebviewLoaderBackground = color(legacyStyles.themeGrayLighter).alpha(0.8).rgb().string();
42
43// Input
44export const labelColor = legacyStyles.themeGrayLight;
45export const inputColor = legacyStyles.themeGray;
46export const inputHeight = 40;
47export const inputBackground = legacyStyles.themeGrayLightest;
48export const inputBorder = `1px solid ${legacyStyles.themeGrayLighter}`;
49export const inputModifierColor = legacyStyles.themeGrayLight;
50export const inputPlaceholderColor = color(legacyStyles.themeGrayLight).lighten(0.3).hex();
51export const inputPrefixColor = legacyStyles.themeGrayLight;
52export const inputPrefixBackground = legacyStyles.themeGrayLighter;
53export const inputDisabledOpacity = 0.5;
54export const inputScorePasswordBackground = legacyStyles.themeGrayLighter;
55
56// Toggle
57export const toggleBackground = legacyStyles.themeGrayLighter;
58export const toggleButton = legacyStyles.themeGrayLight;
59export const toggleButtonActive = brandPrimary;
60export const toggleWidth = 40;
61export const toggleHeight = 14;
62
63// Style Types
64export const styleTypes: IStyleTypes = {
65 primary: {
66 accent: brandPrimary,
67 contrast: '#FFF',
68 },
69 secondary: {
70 accent: legacyStyles.themeGrayLighter,
71 contrast: legacyStyles.themeGray,
72 },
73 success: {
74 accent: brandSuccess,
75 contrast: '#FFF',
76 },
77 warning: {
78 accent: brandWarning,
79 contrast: '#FFF',
80 },
81 danger: {
82 accent: brandDanger,
83 contrast: '#FFF',
84 },
85 inverted: {
86 accent: 'none',
87 contrast: brandPrimary,
88 border: `1px solid ${brandPrimary}`,
89 },
90};
91
92// Button
93export const buttonPrimaryBackground = brandPrimary;
94export const buttonPrimaryTextColor = '#FFF';
95
96export const buttonSecondaryBackground = legacyStyles.themeGrayLighter;
97export const buttonSecondaryTextColor = legacyStyles.themeGray;
98
99export const buttonSuccessBackground = brandSuccess;
100export const buttonSuccessTextColor = '#FFF';
101
102export const buttonDangerBackground = brandDanger;
103export const buttonDangerTextColor = '#FFF';
104
105export const buttonWarningBackground = brandWarning;
106export const buttonWarningTextColor = '#FFF';
107
108export const buttonInvertedBackground = 'none';
109export const buttonInvertedTextColor = brandPrimary;
110export const buttonInvertedBorder = `1px solid ${brandPrimary}`;
111
112export const buttonHeight = inputHeight;
113
114export const buttonLoaderColor = {
115 primary: '#FFF',
116 secondary: buttonSecondaryTextColor,
117 success: '#FFF',
118 warning: '#FFF',
119 danger: '#FFF',
120 inverted: brandPrimary,
121};
122
123// Select
124export const selectBackground = inputBackground;
125export const selectBorder = inputBorder;
126export const selectHeight = inputHeight;
127export const selectColor = inputColor;
128export const selectToggleColor = inputPrefixColor;
129export const selectPopupBackground = '#FFF';
130export const selectOptionColor = inputColor;
131export const selectOptionBorder = `1px solid ${legacyStyles.themeGrayLightest}`;
132export const selectOptionItemHover = legacyStyles.themeGrayLighter;
133export const selectOptionItemHoverColor = selectColor;
134export const selectOptionItemActive = brandPrimary;
135export const selectOptionItemActiveColor = '#FFF';
136export const selectSearchBackground = legacyStyles.themeGrayLighter;
137export const selectSearchColor = inputColor;
138export const selectDisabledOpacity = inputDisabledOpacity;
139
140// Badge
141export const badgeFontSize = uiFontSize - 2;
142export const badgeBorderRadius = 50;
143
144// Modal
145export const colorModalOverlayBackground = color('#000').alpha(0.5).rgb().string();
146
147// Services
148export const services = {
149 listItems: {
150 padding: 10,
151 height: 57,
152 borderColor: legacyStyles.themeGrayLightest,
153 hoverBgColor: legacyStyles.themeGrayLightest,
154 disabled: {
155 color: legacyStyles.themeGrayLight,
156 },
157 },
158};
159
160// Service Icon
161export const serviceIcon = {
162 width: 35,
163 isCustom: {
164 border: `1px solid ${legacyStyles.themeGrayLighter}`,
165 borderRadius: legacyStyles.themeBorderRadius,
166 width: 37,
167 },
168};
169
170// Workspaces
171const drawerBg = color(colorBackground).lighten(0.1).hex();
172
173export const workspaces = {
174 settings: {
175 listItems: cloneDeep(services.listItems),
176 },
177 drawer: {
178 width: 300,
179 padding: 20,
180 background: drawerBg,
181 buttons: {
182 color: color(legacyStyles.themeGrayLight).lighten(0.1).hex(),
183 hoverColor: legacyStyles.themeGrayLight,
184 },
185 listItem: {
186 hoverBackground: color(drawerBg).darken(0.01).hex(),
187 activeBackground: legacyStyles.themeGrayLightest,
188 border: color(drawerBg).darken(0.05).hex(),
189 name: {
190 color: colorText,
191 activeColor: colorText,
192 },
193 services: {
194 color: color(colorText).lighten(1.5).hex(),
195 active: color(colorText).lighten(1.5).hex(),
196 },
197 },
198 },
199 switchingIndicator: {
200 spinnerColor: 'white',
201 },
202};
203
204// Announcements
205export const announcements = {
206 spotlight: {
207 background: legacyStyles.themeGrayLightest,
208 },
209};
diff --git a/packages/theme/src/themes/legacy/index.ts b/packages/theme/src/themes/legacy/index.ts
new file mode 100644
index 000000000..2114b92c1
--- /dev/null
+++ b/packages/theme/src/themes/legacy/index.ts
@@ -0,0 +1,38 @@
1/* legacy config, injected into sass */
2export const themeBrandPrimary = '#3498db';
3export const themeBrandSuccess = '#5cb85c';
4export const themeBrandInfo = '#5bc0de';
5export const themeBrandWarning = '#FF9F00';
6export const themeBrandDanger = '#d9534f';
7
8export const themeGrayDark = '#373a3c';
9export const themeGray = '#55595c';
10export const themeGrayLight = '#818a91';
11export const themeGrayLighter = '#eceeef';
12export const themeGrayLightest = '#f7f7f9';
13
14export const themeBorderRadius = '6px';
15export const themeBorderRadiusSmall = '3px';
16
17export const themeSidebarWidth = '68px';
18
19export const themeTextColor = themeGrayDark;
20
21export const themeTransitionTime = '.5s';
22
23export const themeInsetShadow = 'inset 0 2px 5px rgba(0, 0, 0, .03)';
24
25export const darkThemeBlack = '#1A1A1A';
26
27export const darkThemeGrayDarkest = '#1E1E1E';
28export const darkThemeGrayDarker = '#2D2F31';
29export const darkThemeGrayDark = '#383A3B';
30
31export const darkThemeGray = '#47494B';
32
33export const darkThemeGrayLight = '#515355';
34export const darkThemeGrayLighter = '#8a8b8b';
35export const darkThemeGrayLightest = '#FFFFFF';
36
37export const darkThemeGraySmoke = '#CED0D1';
38export const darkThemeTextColor = '#FFFFFF';