-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
61 lines (52 loc) · 1.17 KB
/
index.js
File metadata and controls
61 lines (52 loc) · 1.17 KB
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
import { rem } from 'polished'
import { string } from 'prop-types'
import styled from 'styled-components'
const VARIANT = Object.freeze({
h2: 'h2',
h3: 'h3',
})
const Heading = ({ variant, ...props }) => {
switch (variant) {
case VARIANT.h2:
return <StyledHeading2 {...props} />
case VARIANT.h3:
return <StyledHeading3 {...props} />
case VARIANT.h4:
return <StyledHeading4 {...props} />
default:
return <StyledHeading1 {...props} />
}
}
Heading.VARIANT = VARIANT
Heading.propTypes = {
variant: string,
}
const StyledHeading1 = styled.h1`
font-size: ${rem('64px')};
font-weight: 800;
line-height: ${rem('80px')};
letter-spacing: 0rem;
margin-top: ${rem('-14px')};
`
const StyledHeading2 = styled.h2`
font-size: 1.125rem;
font-weight: 800;
line-height: 1.375rem;
letter-spacing: 0.1rem;
color: #54ffff;
text-transform: uppercase;
margin-top: 2.625rem;
margin-bottom: 0rem;
:first-of-type {
margin-top: 5.25rem;
}
`
const StyledHeading3 = styled.h3`
font-weight: 500;
font-size: ${rem('18px')};
`
const StyledHeading4 = styled.h3`
font-weight: 1000;
font-size: ${rem('18px')};
`
export default Heading