-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathtext.tsx
96 lines (80 loc) · 2.45 KB
/
text.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import styled from '@emotion/styled';
interface HeaderProps {
marginless?: boolean;
}
export const HeaderOne = styled.h1`
font-family: ${props => props.theme.fonts.work.light};
font-weight: 300;
font-size: ${props => props.theme.sizes.xxl};
line-height: 52px;
`;
export const HeaderTwo = styled.h2`
font-family: ${props => props.theme.fonts.open.regular};
font-size: ${props => props.theme.sizes.m};
line-height: 26px;
`;
export const HeaderThree = styled.h3`
font-family: ${props => props.theme.fonts.open.light};
font-size: ${props => props.theme.sizes.l};
line-height: 30px;
letter-spacing: 2.7px;
text-transform: uppercase;
`;
export const HeaderFour = styled.h4<HeaderProps>`
font-family: ${props => props.theme.fonts.open.semiBold};
font-size: ${props => props.theme.sizes.xs};
line-height: 20px;
text-transform: uppercase;
color: ${props => props.theme.colors.gray};
margin-bottom: ${props => (props.marginless ? '0' : '0.5rem')};
`;
export const HeaderFive = styled.h5`
font-family: ${props => props.theme.fonts.open.bold};
font-size: ${props => props.theme.sizes.m};
`;
export const Small = styled.span`
font-size: ${props => props.theme.sizes.xs};
line-height: 20px;
`;
export const Jumbo = styled.span`
font-size: ${props => props.theme.sizes.xl};
line-height: 38px;
`;
//
// v2 Text Styles
//
interface TextProps {
bold?: boolean;
semiBold?: boolean;
center?: boolean;
block?: boolean;
muted?: boolean;
space?: 8 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 96 | 120 | 160 | 200;
desktopSpace?: 8 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64 | 96 | 120 | 160 | 200;
}
const BaseText = styled.span<TextProps>`
// On larger devices, make bold elements bold instead of semi-bold
font-family: ${props =>
props.bold
? props.theme.fonts.open.bold
: props.semiBold
? props.theme.fonts.open.semiBold
: props.theme.fonts.open.regular};
// The text-align property is ignored on mobile
${props => props.muted && `color: ${props.theme.colors.gray};`}
${props => props.space && `margin-bottom: ${props.space}px;`}
text-align: ${props => (props.center ? 'center' : 'left')};
`;
const BaseBlock = BaseText.withComponent('div');
export const DisplayLarge = styled(BaseBlock)`
font-size: 40px;
line-height: 48px;
`;
export const Display = styled(BaseBlock)`
font-size: 32px;
line-height: 40px;
`;
export const Paragraph = styled(BaseBlock)`
font-size: 16px;
line-height: 24px;
`;