-
Notifications
You must be signed in to change notification settings - Fork 12
/
header-footer.css
224 lines (215 loc) · 5.14 KB
/
header-footer.css
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
/* HEADER */
header {
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 999;
width: 100%;
background: #5cdb94;
color: #17242a;
font-size: 16px;
display: flex;
align-items: stretch;
justify-content: space-between;
}
header a:focus,
header a:hover {
text-decoration: none;
color: currentColor;
}
header .logo {
color: inherit;
text-decoration: none;
display: block;
line-height: 2em;
padding-left: 20px;
padding-top: 0.5em;
}
header .name {
font-weight: bold;
font-size: 1.5em;
}
header .slogan {
margin-left: 1em;
padding-left: 1em;
border-left: 1px solid currentColor;
}
header nav {
display: flex;
padding-right: 20px;
}
header nav .item,
header label {
text-decoration: none;
display: block;
padding: 0.5em 1em;
line-height: 2em;
cursor: pointer;
color: inherit;
font-weight: normal;
white-space: nowrap;
}
header label {
padding: 0.5em 20px;
}
header nav .item.boxed:focus,
header nav .item.boxed:hover {
background-color: transparent;
color: #17242a;
}
@media not all and (max-width: 900px) {
header nav .item:not(.boxed) {
box-shadow: inset 0 0 currentColor;
transition: box-shadow 0.1s;
}
header nav .item:not(.boxed):focus,
header nav .item:not(.boxed):hover {
box-shadow: inset 0 -4px #17242a;
}
header nav .item.boxed {
margin: 0 0 0 0.5em;
padding: 0 calc(1em + 2px);
background-clip: padding-box;
background-color: #17242a;
color: #fff;
box-shadow: inset 0 0 0 2px #17242a;
border-radius: 0.8em;
/* Note IE/Edge mangle this; workaround at EOF */
border: calc(0.5em + 0.4px) solid #5cdb94;
}
header #show-nav,
header label {
display: none;
}
}
@media (max-width: 1000px) {
header .slogan {
display: none;
}
}
@media (max-width: 900px) {
header #show-nav:checked ~ .logo {
z-index: 10;
padding-top: 13px;
}
header #show-nav:checked ~ .logo .slogan {
display: none;
}
header #show-nav:checked ~ label {
padding: 15px 20px 0.5em 20px;
}
header #show-nav {
display: block;
position: absolute;
top: -99em;
left: -99em;
}
header #show-nav ~ label {
position: relative;
z-index: 10;
background: transparent; /* remove background in safari */
}
header #show-nav:not(:checked) ~ label::before {
content: "Menu";
margin-right: 0.5em;
}
header #show-nav ~ label::after {
content: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='15'%20height='11'%3E%3Cpath%20d='M0,.5h15m0,5h-15m0,5h15'%20stroke='%2317242a'/%3E%3C/svg%3E");
}
header #show-nav:checked ~ label::after {
content: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='16'%20height='16'%3E%3Cpath%20d='M0,0l16,16m0-16l-16,16'%20stroke='%2317242a'/%3E%3C/svg%3E");
}
header #show-nav:not(:checked) ~ nav {
display: none;
}
header nav.collapsible {
position: fixed;
overflow: auto;
z-index: 9;
flex-direction: column;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #69b3e7;
background: linear-gradient(#5cdb94, #3aafa9);
padding: 60px 0;
/* 3em is exact, then some vh factor added for prettiness;
* 40vw - 60px is eyeballed to be 60px at 300px wide & 260 at 800 */
box-shadow: 0.1em 0.2em 0.3em rgba(51, 62, 72, -0.5);
text-align: left;
border-radius: 0 0 0.2em 0.2em;
animation: 0.2s nav-appear;
}
header nav .item {
padding: 10px 20px;
margin: 0;
border-bottom: 1px solid #fff 8;
box-sizing: border-box;
}
header nav .item:not(.boxed):focus,
header nav .item:not(.boxed):hover {
background: #17242a;
color: #fff;
}
header nav .item.boxed {
margin: 30px 20px 0 20px;
border: 1px solid #17242a;
border-radius: 4px;
text-align: center;
padding: 5px 0;
box-sizing: border-box;
background-color: #17242a;
color: #fff;
}
}
@keyframes nav-appear {
0% {
opacity: 0;
}
}
/* IE and Edge≤15 mangle the inner shadow radius; I reported it at
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12515080/
and it got fixed for Edge 16. I have no good CSS hack to target Edge≤15, so I’m
just going to ignore it, and only fix it for IE. */
@media not all and (max-width: 900px) {
_:-ms-input-placeholder, /* this selector targets IE10–11 only */
body > header > nav .item.boxed {
/* We *could* make this abandon the border and padding trick, but this
* time I’m just going to drop the border-radius. More succinct. */
border-radius: 0;
}
}
/* FOOTER */
footer {
position: relative;
z-index: 999;
background: #5cdb94;
text-align: center;
padding: 15px 0;
}
footer a {
display: inline-block;
padding: 0 1em;
color: #17242a !important;
text-decoration: none;
}
footer a:focus,
footer a:hover {
text-decoration: underline;
}
@media (max-width: 600px) {
footer a {
padding: 0.5em 1em;
}
}
/* Footer ribbon
body::after {
content: "";
display: block;
width: 100%;
height: 5px;
background: linear-gradient(90deg, #17242a, #0fe7dc, #17242a);
position: relative;
z-index: 1000;
}*/