-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathHeader.styles.ts
More file actions
124 lines (108 loc) · 2.44 KB
/
Header.styles.ts
File metadata and controls
124 lines (108 loc) · 2.44 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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
import styled from "styled-components"
import { Link } from "gatsby"
import { breakpoints } from "../Shared"
export const HeaderStyled = styled.header`
max-width: 1440px;
padding: 24px;
margin-bottom: 1.45rem;
display: flex;
align-items: center;
background: #fff;
margin: 0 auto;
`
export const LinkStyled = styled(Link)`
width: 200px;
@media ${breakpoints.md} {
width: 300px;
min-width: 200px;
}
`
export const Nav = styled.nav<{ isOpen: boolean }>`
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
width: 100%;
height: 100vh;
position: fixed;
top: 0;
bottom: 0;
right: ${({ isOpen }) => (isOpen ? "0" : "-100%")};
transition: right 0.3s ease;
background-color: #fff;
z-index: 5;
@media ${breakpoints.md} {
margin-left: 48px;
position: initial;
flex-direction: row;
flex-grow: 1;
background-color: initial;
width: auto;
height: 100%;
}
a {
padding: 24px 16px;
text-decoration: none;
color: #595959;
margin-bottom: 1rem;
@media ${breakpoints.md} {
margin-bottom: 0;
}
&:hover {
font-weight: bold;
border-bottom: 3px solid hsl(240, 74%, 31%);
}
}
`
export const StyledButton = styled.button`
padding: 0px 24px;
height: 48px;
align-self: center;
border: none;
background-color: hsl(240, 74%, 31%);
color: hsl(230, 100%, 91%);
cursor: pointer;
font-size: 20px;
border: 1px solid transparent;
border-radius: 4px;
@media ${breakpoints.md} {
margin-left: auto;
}
`
export const StyledBurger = styled.button<{ isOpen: boolean }>`
display: flex;
flex-direction: column;
justify-content: space-around;
width: 2rem;
height: 2rem;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
margin-left: auto;
z-index: 10;
outline: none;
@media ${breakpoints.md} {
display: none;
}
span {
width: 2rem;
height: 0.25rem;
background: #595959;
border-radius: 10px;
transition: all 0.3s linear;
position: relative;
transform-origin: 1px;
:first-child {
transform: ${({ isOpen }) => (isOpen ? "rotate(45deg)" : "rotate(0)")};
}
:nth-child(2) {
opacity: ${({ isOpen }) => (isOpen ? "0" : "1")};
transform: ${({ isOpen }) =>
isOpen ? "translateX(20px)" : "translateX(0)"};
}
:nth-child(3) {
transform: ${({ isOpen }) => (isOpen ? "rotate(-45deg)" : "rotate(0)")};
}
}
`