1
+ import { theme } from "@chakra-ui/core"
2
+
1
3
const maxContainerWidth = '70rem'
2
4
const baseLineHeight = 1.45 ; //24.8px
3
5
const desktopBaseSize = 1.125 ; //18px
4
6
const mobileBaseSize = 1 ; //16px
5
7
const breakpoints = [
6
- '52em ' ,
8
+ '48rem ' ,
7
9
]
8
10
const scale = [
9
- 0.75 , 1 , 1.2 , 1.375 , 1.6875 , 2.5
11
+ 0.75 , 1 , 1.2 , 1.375 , 1.6875 , 2.5
10
12
] ;
11
13
12
14
const fontSizes = scale . map ( n => n * mobileBaseSize + 'rem' )
15
+ //desktops
13
16
fontSizes . desktop = scale . map ( n => n * desktopBaseSize + 'rem' )
14
17
15
18
const fonts = {
@@ -18,6 +21,13 @@ const fonts = {
18
21
bold : 'TiemposBold' ,
19
22
italic : 'TiemposItalic'
20
23
}
24
+
25
+ theme . sizes [ 'maxContainerWidth' ] = maxContainerWidth
26
+
27
+ theme . borders [ '3px' ] = '3px solid'
28
+
29
+ const radii = [ 0 , 1 , 2 , 4 , 8 , 16 ] ;
30
+
21
31
const lineHeights = [
22
32
0.5 * baseLineHeight + 'rem' ,
23
33
1 * baseLineHeight + 'rem' ,
@@ -26,110 +36,24 @@ const lineHeights = [
26
36
2.5 * baseLineHeight + 'rem' ,
27
37
3 * baseLineHeight + 'rem' ,
28
38
] ;
29
- const space = [ 0 , ...lineHeights ] ;
39
+
40
+ const space = [ 0 , ...lineHeights ] ;
30
41
31
42
const colors = {
32
43
tint : '#F8F4F2' ,
33
- black : [ '#0F0F0F' , '#333333' , '#666666' , '#999999' ] ,
44
+ black : [ '#0F0F0F' , '#333333' , '#666666' , '#999999' , '#E0E0E0' ] ,
34
45
}
35
46
colors . primary = colors . black [ 1 ]
36
47
colors . secondary = colors . tint
37
48
38
- const styles = {
39
- body :{
40
- fontFamily : 'body' ,
41
- fontSize : [ 1 , 'desktop.1' ] ,
42
- lineHeight : 1 ,
43
- } ,
44
- h1 : {
45
- fontFamily : 'heading' ,
46
- fontSize : [ 5 , 'desktop.5' ] ,
47
- lineHeight : 3 ,
48
- marginTop : [ 3 , 4 ] ,
49
- marginBottom : 1 ,
50
- padding : 0 ,
51
- } ,
52
- h2 : {
53
- fontFamily : 'heading' ,
54
- fontSize : [ 4 , 'desktop.4' ] ,
55
- lineHeight : 2 ,
56
- marginTop : [ 3 , 4 ] ,
57
- marginBottom : 1 ,
58
- padding : 0 ,
59
- } ,
60
- h3 : {
61
- fontFamily : 'heading' ,
62
- fontSize : [ 3 , 'desktop.3' ] ,
63
- lineHeight : 1 ,
64
- marginTop : [ 2 , 3 ] ,
65
- marginBottom : 1 ,
66
- padding : 0 ,
67
- } ,
68
- h4 : {
69
- fontFamily : 'heading' ,
70
- fontSize : [ 2 , 'desktop.2' ] ,
71
- lineHeight : 1 ,
72
- marginTop : 2 ,
73
- marginBottom : 1 ,
74
- padding : 0 ,
75
- } ,
76
- h5 : {
77
- fontFamily : 'heading' ,
78
- fontSize : [ 1 , 'desktop.1' ] ,
79
- lineHeight : 1 ,
80
- marginTop : 2 ,
81
- marginBottom : 1 ,
82
- padding : 0 ,
83
- } ,
84
- p : {
85
- fontFamily : 'body' ,
86
- fontSize : [ 1 , 'desktop.1' ] ,
87
- lineHeight : 1 ,
88
- maxWidth : '40rem' ,
89
- marginBottom : [ 2 , 2 ]
90
- } ,
91
- b : {
92
- fontFamily : 'bold' ,
93
- } ,
94
- strong : {
95
- fontFamily : 'bold'
96
- } ,
97
- em : {
98
- fontFamily : 'italic'
99
- } ,
100
- i : {
101
- fontFamily : 'italic' ,
102
- } ,
103
- Container : {
104
- maxWidth : '71.5rem' ,
105
- padding : 0 ,
106
- px : [ '0.725rem' ]
107
- } ,
108
- ul : {
109
- listStyle : 'disc inside none' ,
110
- mb : [ 2 , 2 ]
111
- } ,
112
- ol : {
113
- listStyle : 'decimal inside none' ,
114
- } ,
115
- li : {
116
- mb : [ '0.5rem' , '0.5rem' ] ,
117
- fontFamily : 'body' ,
118
- fontSize : [ 1 , 'desktop.1' ] ,
119
- lineHeight : 1 ,
120
- maxWidth : '40rem' ,
121
- marginBottom : [ 1 , 1 ]
122
- }
123
- }
124
-
125
- const theme = {
49
+ const customTheme = {
50
+ ...theme ,
126
51
breakpoints,
127
52
space,
128
53
fontSizes,
54
+ radii,
129
55
lineHeights,
130
- maxContainerWidth,
131
56
fonts,
132
57
colors,
133
- styles,
134
58
}
135
- export default theme ;
59
+ export default customTheme ;
0 commit comments