forked from dream-ellie/responsive-nav-bar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle.css
119 lines (102 loc) · 1.9 KB
/
style.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
/* Global */
:root {
--text-color: #f0f4f5;
--background-color: #263343;
--accent-color: #d49466;
}
* {
/* Tells the browser to account for any border and
padding in the values you specify for an element's
width and height. */
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Source Sans Pro';
}
a {
text-decoration: none;
color: var(--text-color);
}
/* Nav container */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 12px;
background-color: var(--background-color);
}
/* Logo with text */
.navbar__logo {
font-size: 24px;
color: var(--text-color);
}
.navbar__logo i {
color: var(--accent-color);
}
/* Menu */
.navbar__menu {
display: flex;
padding-left: 0;
list-style: none;
}
.navbar__menu li {
padding: 8px 12px;
}
.navbar__menu li:hover {
background-color: var(--accent-color);
border-radius: 4px;
}
.navbar__icons {
list-style: none;
color: var(--text-color);
display: flex;
padding-left: 0;
}
/* Icons */
.navbar__icons li {
padding: 8px 12px;
}
/* Toggle button */
.navbar__toggleBtn {
display: none;
position: absolute;
right: 32px;
font-size: 24px;
color: var(--accent-color);
}
/* For small screen */
@media screen and (max-width: 768px) {
/* Nav container */
.navbar {
flex-direction: column;
align-items: flex-start;
padding: 8px 24px;
}
/* Menu */
.navbar__menu {
display: none;
flex-direction: column;
text-align: center;
width: 100%;
}
.navbar__menu a {
/* Fill in an entire line so that user can click on any space */
display: block;
}
/* Icons */
.navbar__icons {
display: none;
justify-content: center;
width: 100%;
}
/* Toggle button */
.navbar__toggleBtn {
display: block;
}
/* When toggle button is clicked - active state */
.navbar__menu.active,
.navbar__icons.active {
display: flex;
}
}