@ttoss/theme 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,256 @@
1
+ import { Theme } from 'theme-ui';
2
+ import { fontSizes } from '../../tokens/fontSizes';
3
+ import { fontWeights } from '../../tokens/fontWeights';
4
+ import { letterSpacings } from '../../tokens/letterSpacings';
5
+ import { space } from '../../tokens/space';
6
+
7
+ const coreFonts = {
8
+ main: '"Atkinson Hyperlegible", sans-serif',
9
+ contrast: '"Work Sans", sans-serif',
10
+ monospace: '"Inconsolata", sans-serif',
11
+ };
12
+
13
+ const brandColors = {
14
+ complimentary: '#f5f5f5',
15
+ main: '#292c2a',
16
+ darkNeutral: '#515389',
17
+ accent: '#0000ff',
18
+ lightNeutral: '#e3e3e3',
19
+ };
20
+
21
+ const coreColors = {
22
+ ...brandColors,
23
+ gray100: '#f0f1f3',
24
+ gray200: '#ced1d7',
25
+ gray300: '#acb1ba',
26
+ gray400: '#8b919e',
27
+ gray500: '#6b7280',
28
+ gray600: '#535863',
29
+ gray700: '#3b3f46',
30
+ gray800: '#23252a',
31
+ gray900: '#0b0b0d',
32
+ black: '#000000',
33
+ red100: '#ffebeb',
34
+ red200: '#fdbfbf',
35
+ red300: '#f99595',
36
+ red400: '#f56c6c',
37
+ red500: '#ef4444',
38
+ red600: '#e42828',
39
+ red700: '#c62121',
40
+ white: '#ffffff',
41
+ };
42
+
43
+ const coreBorders = {
44
+ none: '0px solid',
45
+ thin: '1px solid',
46
+ medium: '2px solid',
47
+ thick: '4px solid',
48
+ };
49
+
50
+ const coreRadii = {
51
+ sharp: '0px',
52
+ xs: '2px',
53
+ sm: '4px',
54
+ md: '6px',
55
+ lg: '8px',
56
+ xl: '12px',
57
+ '2xl': '16px',
58
+ '3xl': '24px',
59
+ circle: '9999px',
60
+ };
61
+
62
+ export const BruttalTheme: Theme = {
63
+ /**
64
+ * Tokens
65
+ */
66
+ fontSizes,
67
+ fontWeights,
68
+ letterSpacings,
69
+ space,
70
+ colors: {
71
+ background: coreColors.lightNeutral,
72
+ text: coreColors.gray900,
73
+ muted: coreColors.gray200,
74
+ outline: coreColors.gray200,
75
+ primary: coreColors.main,
76
+ onPrimary: coreColors.white,
77
+ secondary: coreColors.gray500,
78
+ onSecondary: coreColors.white,
79
+ highlight: coreColors.darkNeutral,
80
+ onHighlight: coreColors.white,
81
+ accent: coreColors.accent,
82
+ onAccent: coreColors.white,
83
+ neutral: coreColors.white,
84
+ onNeutral: coreColors.gray900,
85
+ },
86
+ fonts: {
87
+ h1: coreFonts.contrast,
88
+ h2: coreFonts.contrast,
89
+ h3: coreFonts.contrast,
90
+ h4: coreFonts.contrast,
91
+ h5: coreFonts.contrast,
92
+ h6: coreFonts.contrast,
93
+ body: coreFonts.main,
94
+ highlight: coreFonts.main,
95
+ caption: coreFonts.monospace,
96
+ },
97
+ borders: {
98
+ default: coreBorders.medium,
99
+ },
100
+ radii: {
101
+ default: coreRadii.sm,
102
+ },
103
+ /**
104
+ * Global styles
105
+ */
106
+ styles: {
107
+ root: {
108
+ fontFamily: 'body',
109
+ fontWeight: 'normal',
110
+ },
111
+ },
112
+ /**
113
+ * Components
114
+ */
115
+ buttons: {
116
+ accent: {
117
+ backgroundColor: 'accent',
118
+ color: 'onAccent',
119
+ fontFamily: 'highlight',
120
+ fontWeight: 'bold',
121
+ border: 'default',
122
+ borderRadius: 'default',
123
+ borderColor: 'accent',
124
+ ':hover:not(:active,[disabled])': {
125
+ backgroundColor: 'highlight',
126
+ color: 'onHighlight',
127
+ borderColor: 'highlight',
128
+ },
129
+ ':disabled': {
130
+ cursor: 'default',
131
+ backgroundColor: 'muted',
132
+ borderColor: 'muted',
133
+ },
134
+ },
135
+ primary: {
136
+ backgroundColor: 'primary',
137
+ color: 'onPrimary',
138
+ fontFamily: 'body',
139
+ border: 'default',
140
+ borderRadius: 'default',
141
+ borderColor: 'outline',
142
+ ':hover:not(:active,[disabled])': {
143
+ backgroundColor: 'highlight',
144
+ color: 'onHighlight',
145
+ borderColor: 'highlight',
146
+ },
147
+ ':active': {
148
+ backgroundColor: 'primary',
149
+ color: 'onPrimary',
150
+ borderColor: 'outline',
151
+ },
152
+ ':disabled': {
153
+ cursor: 'default',
154
+ backgroundColor: 'muted',
155
+ borderColor: 'muted',
156
+ },
157
+ },
158
+ secondary: {
159
+ backgroundColor: 'secondary',
160
+ color: 'onSecondary',
161
+ fontFamily: 'body',
162
+ border: 'default',
163
+ borderRadius: 'default',
164
+ borderColor: 'outline',
165
+ ':hover:not(:active,[disabled])': {
166
+ backgroundColor: 'highlight',
167
+ color: 'onHighlight',
168
+ borderColor: 'highlight',
169
+ },
170
+ ':disabled': {
171
+ cursor: 'default',
172
+ backgroundColor: 'muted',
173
+ borderColor: 'muted',
174
+ },
175
+ },
176
+ neutral: {
177
+ backgroundColor: 'neutral',
178
+ color: 'onNeutral',
179
+ fontFamily: 'body',
180
+ border: 'default',
181
+ borderRadius: 'default',
182
+ borderColor: 'outline',
183
+ ':hover:not(:active,[disabled])': {
184
+ backgroundColor: 'highlight',
185
+ color: 'onHighlight',
186
+ borderColor: 'highlight',
187
+ },
188
+ ':disabled': {
189
+ cursor: 'default',
190
+ backgroundColor: 'muted',
191
+ borderColor: 'muted',
192
+ },
193
+ },
194
+ danger: {
195
+ color: 'white',
196
+ backgroundColor: 'danger',
197
+ },
198
+ },
199
+ cards: {
200
+ primary: {
201
+ backgroundColor: 'primary',
202
+ border: '1px solid black',
203
+ padding: [4, 5],
204
+ display: 'flex',
205
+ flexDirection: 'column',
206
+ alignItems: 'center',
207
+ width: 'fit-content',
208
+ },
209
+ },
210
+ forms: {
211
+ input: {
212
+ fontFamily: 'body',
213
+ },
214
+ },
215
+ text: {
216
+ default: {
217
+ color: 'text',
218
+ fontFamily: 'body',
219
+ },
220
+ title: {
221
+ fontFamily: 'heading',
222
+ fontSize: 4,
223
+ lineSpace: '3.5',
224
+ },
225
+ h1: {
226
+ fontFamily: 'heading',
227
+ fontSize: '6xl',
228
+ fontWeight: 'bold',
229
+ letterSpacing: 'normal',
230
+ },
231
+ h2: {
232
+ fontFamily: 'heading',
233
+ fontSize: '5xl',
234
+ fontWeight: 'bold',
235
+ letterSpacing: 'normal',
236
+ },
237
+ h3: {
238
+ fontFamily: 'heading',
239
+ fontSize: '4xl',
240
+ fontWeight: 'bold',
241
+ letterSpacing: 'normal',
242
+ },
243
+ h4: {
244
+ fontFamily: 'heading',
245
+ fontSize: '2xl',
246
+ fontWeight: 'bold',
247
+ letterSpacing: 'normal',
248
+ },
249
+ h5: {
250
+ fontFamily: 'heading',
251
+ fontSize: 'xl',
252
+ fontWeight: 'bold',
253
+ letterSpacing: 'normal',
254
+ },
255
+ },
256
+ };
@@ -0,0 +1,16 @@
1
+ export const fontSizes = {
2
+ '2xs': '0.5rem',
3
+ xs: '0.75rem',
4
+ sm: '0.875rem',
5
+ base: '1rem',
6
+ lg: '1.125rem',
7
+ xl: '1.25rem',
8
+ '2xl': '1.5rem',
9
+ '3xl': '1.875rem',
10
+ '4xl': '2.25rem',
11
+ '5xl': '3rem',
12
+ '6xl': '3.75rem',
13
+ '7xl': '4.5rem',
14
+ '8xl': '6rem',
15
+ '9xl': '8rem',
16
+ };
@@ -0,0 +1,10 @@
1
+ export const fontWeights = {
2
+ thin: 100,
3
+ extralight: 200,
4
+ light: 300,
5
+ normal: 400,
6
+ medium: 500,
7
+ semibold: 600,
8
+ bold: 700,
9
+ extrabold: 800,
10
+ };
@@ -0,0 +1,8 @@
1
+ export const letterSpacings = {
2
+ tighter: '-0.05em',
3
+ tight: '-0.025em',
4
+ normal: '0em',
5
+ wide: '0.025em',
6
+ wider: '0.05em',
7
+ widest: '0.1em',
8
+ };
@@ -0,0 +1,15 @@
1
+ export const space = {
2
+ none: 0,
3
+ '2xs': '2px',
4
+ xs: '3px',
5
+ sm: '5px',
6
+ md: '8px',
7
+ lg: '13px',
8
+ xl: '21px',
9
+ '2xl': '34px',
10
+ '3xl': '55px',
11
+ '4xl': '89px',
12
+ '5xl': '144px',
13
+ '6xl': '233px',
14
+ '7xl': '377px',
15
+ };
package/src/index.spec.ts DELETED
@@ -1,8 +0,0 @@
1
- import * as allConfigs from '.';
2
-
3
- it('themes and fonts should be exported', () => {
4
- expect(allConfigs.BruttalFonts).toBeDefined();
5
- expect(allConfigs.BruttalTheme).toBeDefined();
6
- expect(allConfigs.DefaultFonts).toBeDefined();
7
- expect(allConfigs.DefaultTheme).toBeDefined();
8
- });
@@ -1,161 +0,0 @@
1
- import { Theme } from 'theme-ui';
2
-
3
- export const BruttalTheme: Theme = {
4
- colors: {
5
- text: '#0D0D0D',
6
- background: '#fff',
7
- backgroundBrand: '#C2C2C2',
8
- primary: '#0D0D0D',
9
- secondary: '#639',
10
- gray: '#555',
11
- muted: '#f6f6f6',
12
- danger: 'red',
13
- accent: '#0000FF',
14
- textOnSurface: '#FFFFFF',
15
- },
16
- space: [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024],
17
- fonts: {
18
- body: '"Inconsolata", sans-serif',
19
- heading: '"Work Sans", sans-serif',
20
- monospace: '"Inconsolata", sans-serif',
21
- },
22
- fontSizes: {
23
- xxs: '0.5rem',
24
- xs: '0.75rem',
25
- sm: '0.875rem',
26
- base: '1rem',
27
- lg: '1.125rem',
28
- xl: '1.25rem',
29
- '2xl': '1.5rem',
30
- '3xl': '1.875rem',
31
- '4xl': '2.25rem',
32
- '5xl': '3rem',
33
- '6xl': '3.75rem',
34
- '7xl': '4.5rem',
35
- '8xl': '6rem',
36
- '9xl': '8rem',
37
- },
38
- fontWeights: {
39
- thin: 100,
40
- extralight: 200,
41
- light: 300,
42
- normal: 400,
43
- medium: 500,
44
- semibold: 600,
45
- bold: 700,
46
- extrabold: 800,
47
- },
48
- letterSpacings: {
49
- tighter: '-0.05em',
50
- tight: '-0.025em',
51
- normal: '0em',
52
- wide: '0.025em',
53
- wider: '0.05em',
54
- widest: '0.1em',
55
- },
56
- styles: {
57
- root: {
58
- fontFamily: 'body',
59
- fontWeight: 'normal',
60
- },
61
- a: {
62
- color: 'primary',
63
- textDecoration: 'underline',
64
- cursor: 'pointer',
65
- fontFamily: 'body',
66
- },
67
- progress: {
68
- color: 'primary',
69
- backgroundColor: 'background',
70
- },
71
- },
72
- borders: [0, '3px solid #0D0D0D'],
73
- buttons: {
74
- cta: {
75
- color: 'white',
76
- backgroundColor: 'primary',
77
- },
78
- muted: {
79
- color: 'text',
80
- backgroundColor: 'muted',
81
- },
82
- danger: {
83
- color: 'white',
84
- backgroundColor: 'danger',
85
- },
86
- primary: {
87
- ':disabled': {
88
- backgroundColor: 'backgroundBrand',
89
- cursor: 'default',
90
- },
91
- },
92
- secondary: {
93
- color: 'text',
94
- backgroundColor: 'white',
95
- borderColor: 'text',
96
- borderWidth: 1,
97
- borderStyle: 'solid',
98
- ':disabled': {
99
- opacity: 0.5,
100
- cursor: 'default',
101
- },
102
- },
103
- },
104
- cards: {
105
- primary: {
106
- backgroundColor: 'background',
107
- border: '1px solid black',
108
- padding: [4, 5],
109
- display: 'flex',
110
- flexDirection: 'column',
111
- alignItems: 'center',
112
- width: 'fit-content',
113
- },
114
- },
115
- forms: {
116
- input: {
117
- fontFamily: 'body',
118
- },
119
- },
120
- text: {
121
- default: {
122
- color: 'text',
123
- fontFamily: 'body',
124
- },
125
- title: {
126
- fontFamily: 'heading',
127
- fontSize: 4,
128
- lineSpace: '3.5',
129
- },
130
- h1: {
131
- fontFamily: 'heading',
132
- fontSize: '6xl',
133
- fontWeight: 'bold',
134
- letterSpacing: 'normal',
135
- },
136
- h2: {
137
- fontFamily: 'heading',
138
- fontSize: '5xl',
139
- fontWeight: 'bold',
140
- letterSpacing: 'normal',
141
- },
142
- h3: {
143
- fontFamily: 'heading',
144
- fontSize: '4xl',
145
- fontWeight: 'bold',
146
- letterSpacing: 'normal',
147
- },
148
- h4: {
149
- fontFamily: 'heading',
150
- fontSize: '2xl',
151
- fontWeight: 'bold',
152
- letterSpacing: 'normal',
153
- },
154
- h5: {
155
- fontFamily: 'heading',
156
- fontSize: 'xl',
157
- fontWeight: 'bold',
158
- letterSpacing: 'normal',
159
- },
160
- },
161
- };
@@ -1,6 +0,0 @@
1
- export const DefaultFonts = [
2
- 'https://fonts.googleapis.com/css?family=Asap',
3
- 'https://fonts.googleapis.com/css?family=Overpass',
4
- 'https://fonts.googleapis.com/css?family=Overpass+Mono',
5
- 'https://fonts.googleapis.com/css?family=Flamenco',
6
- ];
@@ -1,76 +0,0 @@
1
- import { Theme } from 'theme-ui';
2
-
3
- export const DefaultTheme: Theme = {
4
- colors: {
5
- text: '#000',
6
- background: '#fff',
7
- primary: '#07c',
8
- secondary: '#639',
9
- gray: '#555',
10
- muted: '#f6f6f6',
11
- danger: 'red',
12
- },
13
- space: [0, 4, 8, 16, 32, 64, 128, 256, 512, 1024],
14
- fonts: {
15
- body: '"Asap", sans-serif',
16
- heading: '"Overpass", sans-serif',
17
- monospace: '"Overpass Mono", sans-serif',
18
- },
19
- styles: {
20
- root: {
21
- fontFamily: 'body',
22
- fontWeight: 'body',
23
- },
24
- a: {
25
- color: 'primary',
26
- textDecoration: 'underline',
27
- cursor: 'pointer',
28
- fontFamily: 'body',
29
- },
30
- progress: {
31
- color: 'primary',
32
- backgroundColor: 'background',
33
- },
34
- },
35
- buttons: {
36
- cta: {
37
- color: 'white',
38
- backgroundColor: 'primary',
39
- },
40
- muted: {
41
- color: 'text',
42
- backgroundColor: 'muted',
43
- },
44
- danger: {
45
- color: 'white',
46
- backgroundColor: 'danger',
47
- },
48
- },
49
- cards: {
50
- primary: {
51
- backgroundColor: 'background',
52
- border: '1px solid black',
53
- padding: [4, 5],
54
- display: 'flex',
55
- flexDirection: 'column',
56
- alignItems: 'center',
57
- width: 'fit-content',
58
- },
59
- },
60
- forms: {
61
- input: {
62
- fontFamily: 'body',
63
- },
64
- },
65
- text: {
66
- default: {
67
- color: 'text',
68
- fontFamily: 'body',
69
- },
70
- title: {
71
- fontFamily: 'heading',
72
- fontSize: 4,
73
- lineSpace: '3.5',
74
- },
75
- },
76
- };
@@ -1,2 +0,0 @@
1
- export { BruttalFonts } from './bruttalFonts';
2
- export { DefaultFonts } from './defaultFonts';
@@ -1,2 +0,0 @@
1
- export { DefaultTheme } from './defaultTheme';
2
- export { BruttalTheme } from './bruttalTheme';