-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path_nav.scss
99 lines (84 loc) · 1.63 KB
/
_nav.scss
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
$nav-width: 225px;
.nav {
background-color: #222;
height: 100%;
position: fixed;
text-align: center;
text-transform: uppercase;
z-index: 1;
// fixed transition value
left: -$nav-width;
width: $nav-width;
// menu items
.nav-list {
list-style: none;
margin-left: 0;
> li {
margin: 0;
> a {
border-bottom: 1px solid #555;
color: #eee;
display: block;
font-size: 1.2em;
outline: 0;
padding: 1em 0;
text-decoration: none;
&:hover,
&:focus {
background-color: $white;
color: $lampblack;
cursor: pointer;
}
}
}
}
// close button
#nav-close {
background-color: #333;
border: 2px solid #aaa;
border-radius: 50%;
color: #fafafa;
font-size: 18px;
display: none; // hide the close button by default
margin: 0 auto;
outline: 0;
position: absolute;
top: 0;
// dimensions
line-height: 32px;
right: -18px; // 36 / 2
width: 32px; // width + border = 36
height: 32px;
&:hover,
&:focus {
background-color: $white;
border-color: $white;
color: $black;
cursor: pointer;
}
}
}
.wrap {
// necessary for transition animation
position: relative;
left: 0;
}
.nav,
.wrap {
transition: left 500ms;
}
#nav-toggle {
display: none; // checkbox input will always stay hidden
&:checked {
~ .nav {
left: 0;
// show the close button when the nav is open
#nav-close {
display: block;
}
}
~ .wrap {
left: $nav-width; // fixed transition value
}
}
}