Skip to content

Commit fbec05f

Browse files
committed
added typography components
1 parent 56057f2 commit fbec05f

File tree

1 file changed

+144
-0
lines changed

1 file changed

+144
-0
lines changed

src/components/typo.js

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import React from 'react'
2+
import { PseudoBox } from '@chakra-ui/core';
3+
4+
const H1 = (props) => (
5+
<PseudoBox
6+
as='h1'
7+
fontFamily='heading'
8+
fontSize={[5,'desktop.5']}
9+
lineHeight={3}
10+
mt={[3, 4]}
11+
mb={1}
12+
p={0}
13+
{...props}
14+
/>
15+
)
16+
const H2 = (props) => (
17+
<PseudoBox
18+
as='h2'
19+
fontFamily='heading'
20+
fontSize={[4,'desktop.4']}
21+
lineHeight={2}
22+
mt={[3, 4]}
23+
mb={1}
24+
p={0}
25+
{...props}
26+
/>
27+
)
28+
const H3 = (props) => (
29+
<PseudoBox
30+
as='h3'
31+
fontFamily='heading'
32+
fontSize={[3,'desktop.3']}
33+
lineHeight={1}
34+
mt={[2, 3]}
35+
mb={1}
36+
p={0}
37+
{...props}
38+
/>
39+
)
40+
const H4 = (props) => (
41+
<PseudoBox
42+
as='h4'
43+
fontFamily='heading'
44+
fontSize={[2,'desktop.2']}
45+
lineHeight={1}
46+
mt={2}
47+
mb={1}
48+
p={0}
49+
{...props}
50+
/>
51+
)
52+
const H5 = (props) => (
53+
<PseudoBox
54+
as='h4'
55+
fontFamily='heading'
56+
fontSize={[1,'desktop.1']}
57+
lineHeight={1}
58+
mt={2}
59+
mb={1}
60+
p={0}
61+
{...props}
62+
/>
63+
)
64+
65+
const P = (props) => (
66+
<PseudoBox
67+
as='p'
68+
lineHeight='1'
69+
fontSize={[1, 'desktop.1']}
70+
mb='2'
71+
{...props}
72+
/>
73+
)
74+
75+
const B = (props) => (
76+
<PseudoBox
77+
as='b'
78+
fontFamily='bold'
79+
{...props}
80+
/>
81+
)
82+
const Em = (props) => (
83+
<PseudoBox
84+
as='em'
85+
fontFamily='italic'
86+
{...props}
87+
/>
88+
)
89+
90+
const I = (props) => (
91+
<PseudoBox
92+
as='i'
93+
fontFamily='italic'
94+
{...props}
95+
/>
96+
)
97+
98+
const Ul = (props) => (
99+
<PseudoBox
100+
as='ul'
101+
listStyle='disc inside none'
102+
mb={2}
103+
{...props}
104+
/>
105+
)
106+
const Ol = (props) => (
107+
<PseudoBox
108+
as='ol'
109+
listStyle='decimal inside none'
110+
mb={2}
111+
{...props}
112+
/>
113+
)
114+
const Li = (props) => (
115+
<PseudoBox
116+
as='li'
117+
mb='0.5rem'
118+
fontFamily='body'
119+
fontSize={[1, 'desktop.1']}
120+
maxWidth="40rem"
121+
mb={1}
122+
{...props}
123+
/>
124+
)
125+
126+
const Title = (props) => (
127+
<PseudoBox
128+
as='span'
129+
fontFamily="heading"
130+
fontSize={[4, 'desktop.4']}
131+
lineHeight={2}
132+
mt={[3, 4]}
133+
mb={1}
134+
p={0}
135+
pb="2px"
136+
borderBottom='1px'
137+
borderColor="black.0"
138+
{...props}
139+
/>
140+
);
141+
142+
export {
143+
H1, H2, H3, H4, H5, Title, P, B, Em, I, Ul, Ol, Li
144+
}

0 commit comments

Comments
 (0)