Skip to content

Commit c7b6bd0

Browse files
Merge pull request #519 from rust-lang/improve-responsive-nav-behavior-498
fix(nav): improve responsive nav behavior.
2 parents 837fbc0 + f6119a0 commit c7b6bd0

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/styles/_tachyons-ext.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
// Custom classes we use to extend Tachyons
22

3+
// Note that for *new* definitions we need to apply only at the smallest sizes,
4+
// we have to specify as much (rather than having them be the default), because
5+
// media queries do not increase specificity, and as such our classes will
6+
// *always* trump Tachyon's classes by way of being defined *after* them.
7+
@media screen and (max-width: 30em) {
8+
.flex-20-s {
9+
flex: 0 0 20%;
10+
}
11+
}
12+
313
@media screen and (min-width: 30em) and (max-width: 60em) {
414
.max-width-half-m {
515
max-width: 50%;

templates/nav.hbs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<span class="pl4 db dn-l">{{!-- spacer --}}</span>
88
</a>
99

10-
<ul class="nav list w-100 w-auto-l flex flex-none flex-row flex-wrap justify-center justify-end-l items-center pv2 ph4-ns">
11-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="/tools/install">Install</a></li>
12-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="/learn">Learn</a></li>
13-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="/tools">Tools</a></li>
14-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="/governance">Governance</a></li>
15-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="/community">Community</a></li>
16-
<li class="flex-inline pv2 ph2 ph4-ns"><a href="https://blog.rust-lang.org/" target="_blank" rel="noopener">Blog</a></li>
10+
<ul class="nav list w-100 w-auto-l flex flex-none flex-row flex-wrap justify-center justify-end-l items-center pv2 ph0 ph4-ns">
11+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/tools/install">Install</a></li>
12+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/learn">Learn</a></li>
13+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/tools">Tools</a></li>
14+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/governance">Governance</a></li>
15+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="/community">Community</a></li>
16+
<li class="tc pv2 ph2 ph4-ns flex-20-s"><a href="https://blog.rust-lang.org/" target="_blank" rel="noopener">Blog</a></li>
1717
</ul>
1818

1919
<div class=" w-100 w-auto-l flex-none flex justify-center pv4 pv-0-l languages">

0 commit comments

Comments
 (0)