UNPKG

3.98 kBSCSSView Raw
1// Copyright (c) 2018 Uber Technologies, Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21@import 'variables';
22
23header {
24 position: fixed;
25 display: flex;
26 top: 0;
27 left: 0;
28 width: 100%;
29 transition: all 300ms;
30 max-height: $topbar-height;
31 line-height: $topbar-height;
32 overflow: hidden;
33 user-select: none;
34 white-space: nowrap;
35 z-index: 101;
36
37 .header-content {
38 padding: 0 1rem;
39 width: 100%;
40 }
41
42 .bg {
43 position: absolute;
44 z-index: -1;
45 width: 100%;
46 height: 100%;
47 background: $black;
48 }
49
50 .logo {
51 color: $white !important;
52 font-weight: 500;
53 text-transform: capitalize;
54 }
55
56 .menu-toggle {
57 height: $topbar-height;
58 width: $topbar-height;
59 margin-left: auto;
60 font-size: 24px;
61 color: $white;
62 cursor: pointer;
63 display: none;
64 }
65
66 .links {
67 margin-left: auto;
68 color: $white-40;
69
70 .Stars {
71 margin-left: 0.5rem;
72 padding: 3px 0;
73 min-width: 3.5rem;
74 color: $white;
75 }
76
77 a {
78 display: flex;
79 align-items: center;
80 justify-content: center;
81 padding: 0 0.5rem;
82 height: 100%;
83 color: $white-40;
84 border-style: solid;
85 border-width: 3px 0 3px 0;
86 border-color: transparent;
87 margin-left: 1rem;
88
89 &:hover {
90 border-top-color: $white-40;
91 }
92 }
93
94 a.active {
95 color: $white;
96 border-top-color: $primary;
97 border-top-image: $gradient-1;
98 border-image-slice: 2;
99 }
100
101 .icon {
102 line-height: 0;
103 margin-left: 4px;
104 }
105 }
106}
107
108.site-links {
109 position: fixed;
110 padding-left: 24px;
111 padding-right: 40px;
112 margin-left: -24px;
113 transition: all 300ms;
114 max-height: $topbar-height;
115 overflow: hidden;
116
117 &:after {
118 content: '▾';
119 display: block;
120 position: absolute;
121 top: 0;
122 right: 12px;
123 color: $black-40;
124 }
125
126 .site-link {
127 width: 100%;
128 text-transform: capitalize;
129
130 a {
131 width: 100%;
132 color: $white;
133 }
134
135 &:nth-child(n+2) {
136 opacity: 0.5;
137 }
138 &:hover {
139 opacity: 1 !important;
140 }
141 }
142
143 &:hover {
144 background: $black;
145 max-height: $topbar-height * 5;
146 }
147
148}
149
150@media screen and (max-width: $mobile) {
151 header {
152
153 .header-content {
154 padding-right: 0;
155 }
156
157 .menu-toggle {
158 display: flex;
159 align-items: center;
160 justify-content: center;
161 }
162
163 .links {
164 display: block;
165 margin-top: $topbar-height;
166 transition: max-height 300ms;
167 max-height: 0;
168 position: fixed;
169 width: 100%;
170 z-index: 5;
171 left: 0;
172 overflow: hidden;
173 background: $black;
174 a {
175 height: initial;
176 line-height: $topbar-height;
177 margin-left: 0;
178 border-width: 0;
179 border-style: none;
180 }
181 }
182
183 &.open {
184 .bg {
185 opacity: 1 !important;
186 }
187 .links {
188 display: block;
189 max-height: $topbar-maxheight;
190 }
191 }
192 }
193}