This repository was archived by the owner on Jan 14, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 599
Expand file tree
/
Copy pathmenu.css
More file actions
88 lines (75 loc) · 1.66 KB
/
menu.css
File metadata and controls
88 lines (75 loc) · 1.66 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
/* nav menu */
.header ul {
margin: 0;
padding: 0;
overflow: hidden;
background-color: var(--main__clr);
}
.header ul a {
display: block;
outline: 1px solid var(--accent__clr);
padding: 10px;
}
.header ul a:hover {
background-color: var(--second__clr);
}
.header .menu {
clear: both;
max-height: 0;
transition: max-height 0.2s ease-out;
}
.header .menu__icon {
padding: 50px 0px;
position: relative;
float: right;
cursor: pointer;
}
/* creating the menu icon inside the label tag */
.header .menu__icon .nav__icon {
background: #000;
display: block;
height: 3px;
width: 20px;
position: relative;
transition: background 0.2s ease-out;
}
/* Adds additional lines to menu icon */
.header .menu__icon .nav__icon:before {
background: #000;
content: "";
display: block;
height: 100%;
width: 100%;
position: absolute;
transition: all 0.2s ease-out;
top: 5px;
}
.header .menu__icon .nav__icon:after {
background: #000;
content: "";
display: block;
height: 100%;
width: 100%;
position: absolute;
transition: all 0.2s ease-out;
top: -5px;
}
.header .menu__btn {
display: none;
}
/* general sibling combinator (~) selects the next sibling with class of .menu */
.header .menu__btn:checked ~ .menu {
max-height: 240px;
}
/* menu icon animation */
.header .menu__btn:checked ~ .menu__icon .nav__icon {
background: transparent;
}
.header .menu__btn:checked ~ .menu__icon .nav__icon:before {
top: 0;
transform: rotate(-45deg);
}
.header .menu__btn:checked ~ .menu__icon .nav__icon:after {
top: 0;
transform: rotate(45deg);
}