-
Notifications
You must be signed in to change notification settings - Fork 6
/
demo-nav.css
188 lines (160 loc) · 4.13 KB
/
demo-nav.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
/* Demo Menu Styling - uses display table to get a full width navigation instead of auto width */
body{
margin: 3%
}
body > header{
padding-left: 6.5rem;
padding-left: calc(6rem + 3%);
min-height: 6rem;
overflow-y: hidden;
}
body > header nav {
margin-top: 1.75rem;
overflow: hidden;
border-radius: .4rem;
border: solid 1px #dddddd;
width: calc(100% - 2px);
}
body > header nav ul {
overflow: hidden;
}
body > header nav ul.prioritized:not(.opened) {
width: 100%;
display: table;
padding: 0;
margin-left: -2px;
height: 2.5rem;
height: calc(2.5rem - 2px);
}
body > header nav > ul.toPrioritize > li{
font-family: sans-serif;
text-transform: uppercase;
font-size: .7rem;
font-weight: bold;
letter-spacing: .1em;
overflow: visible;
}
body > header nav ul.prioritized:not(.opened) li,
html body > header nav ul.toPrioritize.prioritized.truncated > li[data-priority="more"]{
display: table-cell;
position: relative;
vertical-align: middle;
}
body > header nav ul.prioritized:not(.opened) li:not(.menu) a:before{
content: "";
position: absolute;
height: 2em;
margin-top: -1em;
top: 50%;
width: 1px;
background: #eeeeee;
left: 0;
}
body > header nav ul.prioritized.opened,
body > header nav ul.prioritized.opened li,
body > header nav ul:not(.prioritized),
body > header nav ul:not(.prioritized) li {
margin: 0;
}
body > header nav ul.prioritized.opened,
body > header nav ul:not(.prioritized){
position: relative
}
body > header nav ul.prioritized.opened li,
body > header nav ul:not(.prioritized) li{
vertical-align: top;
margin-top: -1px;
}
body > header nav ul.prioritized.opened li:before,
body > header nav ul:not(.prioritized) li:before{
content: "";
position: absolute;
height: 1px;
width: 94%;
background: #eeeeee;
left: 3%;
}
body > header nav ul.prioritized.opened li:nth-child(odd):not([data-priority="more"]):not([data-priority="less"]) a:before,
body > header nav ul:not(.prioritized) li:nth-child(odd):not([data-priority="more"]):not([data-priority="less"]) a:before{
content: "";
position: absolute;
height: 2em;
width: 1px;
background: #eeeeee;
right: 0;
top: 50%;
margin-top: -1em;
}
body > header nav ul.toPrioritize > li a{
padding: .75rem 1.25rem;
color: #aaaaaa;
transition: color.33s;
overflow: visible;
overflow: visible;
}
body > header nav ul.toPrioritize.opened > li a {
padding-top: .9rem ;
padding-bottom: .9rem;
}
body > header nav ul.prioritized> li[data-priority="more"] a:after,
body > header nav ul.prioritized> li[data-priority="less"] a:after{
content: "";
display: inline-block;
width: 0;
height: 0;
border-left: .9ex solid transparent;
border-right: .9ex solid transparent;
vertical-align: middle;
margin: 0 0 .2em .25em;
transition: border-color.33s
}
body > header nav ul.prioritized> li[data-priority="more"] a::after{
border-top: 1ex solid #bbbbbb;
}
body > header nav ul.prioritized> li[data-priority="less"] a::after{
border-bottom: 1ex solid #bbbbbb;
}
body > header nav ul.toPrioritize > li a:hover,
body > header nav ul.toPrioritize > li a:focus {
text-decoration: none;
color: #555555;
}
body > header nav ul.prioritized> li[data-priority="more"] a:hover::after,
body > header nav ul.prioritized> li[data-priority="more"] a:focus::after,
body > header nav ul.prioritized> li[data-priority="less"] a:hover::after,
body > header nav ul.prioritized> li[data-priority="less"] a:focus::after{
border-top-color: #666666;
border-bottom-color: #666666;
}
@media only screen and (max-width: 45em) {
body > header{
padding-left: 3rem;
padding-left: calc(2.5rem + 3%);
height: auto;
min-height: 0;
}
body > header #logo{
height: 0;
width: 1em;
padding: 1.25rem 0;
font-size: 2.5rem;
line-height: 0;
overflow: visible;
margin-left: 3rem;
margin-left: calc(-2.5rem - 3%);
}
body > header > nav{
margin-top: 0;
line-height: 1.125rem;
}
}
@media only screen and (max-width: 30em) {
body > header nav ul.toPrioritize.prioritized.opened > li,
body > header nav ul.toPrioritize.prioritized.opened > li.demoted,
body > header nav ul.toPrioritize:not(.prioritized) > li{
width: 100%;
}
body > header nav ul.opened li:nth-child(odd) a:before{
display: none;
}
}