Skip to content

Commit 45e9af4

Browse files
committed
style.css: fluid spacing of nav-links for mobile
Before we had a set gap inbetween each link. That means that carriage returns happen quickly on mobile. Once we switch to mobile width, let flexbox justify-content spread links on the line. It'll wrap once there is no more space. Previously, most mobiles showed two lines of links. Now we only have one (but links are closer). Signed-off-by: Théo Lebrun <[email protected]>
1 parent 5a225c5 commit 45e9af4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

static/style.css

+11-4
Original file line numberDiff line numberDiff line change
@@ -1512,17 +1512,18 @@ main {
15121512
}
15131513

15141514
.nav-links {
1515+
/* Fixed spacing between links */
1516+
display: flex;
1517+
flex-wrap: wrap;
1518+
justify-content: center;
1519+
gap: 2ch;
15151520
padding: 0.5em 1em;
15161521
margin: 0;
15171522
background-color: rgba(0,0,0,.5);
15181523
width: 100%;
15191524
font-size: 0.8em;
15201525
line-height: 1.7;
15211526
}
1522-
.nav-links li {
1523-
display: inline-block;
1524-
margin: 0 0.5em;
1525-
}
15261527
.nav-links a {
15271528
text-transform: uppercase;
15281529
color: #9da9ea;
@@ -1556,6 +1557,12 @@ main {
15561557
/* responsive */
15571558

15581559
@media (max-width: 748px) {
1560+
.nav-links {
1561+
/* Fluid spacing to avoid carriage returns on mobile */
1562+
padding: 0.5em 0;
1563+
justify-content: space-around;
1564+
gap: 0;
1565+
}
15591566
.banners {
15601567
justify-content: flex-start;
15611568
}

templates/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
Elixir Cross Referencer - Explore source code in your browser - Particularly useful for the Linux kernel and other low-level projects in C/C++ (bootloaders, C libraries...)
1616
{%- endblock %}">
1717
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1" />
18-
<link rel="stylesheet" href="/static/style.css?v=15">
18+
<link rel="stylesheet" href="/static/style.css?v=16">
1919

2020
<link rel="preload" href="/static/img/2penguins.svg" as="image" />
2121
<link rel="preload" href="/static/img/arrow-dropdown-16.svg" as="image" />

0 commit comments

Comments
 (0)