Skip to content

Commit 56057f2

Browse files
committed
added a doc
1 parent e486ccf commit 56057f2

File tree

4 files changed

+19002
-96
lines changed

4 files changed

+19002
-96
lines changed

docs/button.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: test
3+
---
4+
import { Playground } from 'docz'
5+
import {Box} from '@chakra-ui/core'
6+
import Button from '../src/components/button.js'
7+
8+
## Button
9+
<Playground>
10+
<Button>hi</Button>
11+
</Playground>
12+
13+
Here are the props i can give the button

docs/config/theme.js

Lines changed: 19 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
import { theme } from "@chakra-ui/core"
2+
13
const maxContainerWidth = '70rem'
24
const baseLineHeight = 1.45; //24.8px
35
const desktopBaseSize = 1.125; //18px
46
const mobileBaseSize = 1; //16px
57
const breakpoints = [
6-
'52em',
8+
'48rem',
79
]
810
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
1012
];
1113

1214
const fontSizes = scale.map(n=> n*mobileBaseSize + 'rem')
15+
//desktops
1316
fontSizes.desktop = scale.map(n=> n*desktopBaseSize + 'rem')
1417

1518
const fonts = {
@@ -18,6 +21,13 @@ const fonts = {
1821
bold: 'TiemposBold',
1922
italic: 'TiemposItalic'
2023
}
24+
25+
theme.sizes['maxContainerWidth'] = maxContainerWidth
26+
27+
theme.borders['3px'] = '3px solid'
28+
29+
const radii = [0, 1, 2, 4, 8, 16];
30+
2131
const lineHeights = [
2232
0.5 * baseLineHeight + 'rem',
2333
1 * baseLineHeight + 'rem',
@@ -26,110 +36,24 @@ const lineHeights = [
2636
2.5 * baseLineHeight + 'rem',
2737
3 * baseLineHeight + 'rem',
2838
];
29-
const space = [0,...lineHeights];
39+
40+
const space = [0, ...lineHeights];
3041

3142
const colors = {
3243
tint: '#F8F4F2',
33-
black: ['#0F0F0F','#333333', '#666666', '#999999'],
44+
black: ['#0F0F0F','#333333', '#666666', '#999999', '#E0E0E0'],
3445
}
3546
colors.primary = colors.black[1]
3647
colors.secondary = colors.tint
3748

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,
12651
breakpoints,
12752
space,
12853
fontSizes,
54+
radii,
12955
lineHeights,
130-
maxContainerWidth,
13156
fonts,
13257
colors,
133-
styles,
13458
}
135-
export default theme;
59+
export default customTheme;

docs/config/wrapper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
2-
import { ThemeProvider } from 'bricks'
2+
import { ThemeProvider } from '@chakra-ui/core'
33
import theme from './theme'
44

55
global.__PATH_PREFIX__ = ''

0 commit comments

Comments
 (0)