Skip to content

Commit 44d9b8d

Browse files
committed
rustdoc: clean up CSS #titles using flexbox
This commit allows it to stop manually specifying pixel heights for the tabs on search result pages. There's less messing with manual breakpoints and less complex CSS selectors.
1 parent c97922d commit 44d9b8d

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

src/librustdoc/html/static/css/rustdoc.css

+6-23
Original file line numberDiff line numberDiff line change
@@ -1378,27 +1378,19 @@ pre.rust {
13781378
}
13791379

13801380
#titles {
1381-
height: 35px;
1381+
display: flex;
1382+
flex-direction: row;
1383+
gap: 1px;
1384+
margin-bottom: 4px;
13821385
}
13831386

13841387
#titles > button {
1385-
float: left;
1386-
width: 33.3%;
13871388
text-align: center;
13881389
font-size: 1.125rem;
13891390
cursor: pointer;
13901391
border: 0;
13911392
border-top: 2px solid;
1392-
}
1393-
1394-
#titles > button:first-child:last-child {
1395-
margin-right: 1px;
1396-
width: calc(100% - 1px);
1397-
}
1398-
1399-
#titles > button:not(:last-child) {
1400-
margin-right: 1px;
1401-
width: calc(33.3% - 1px);
1393+
flex: 1;
14021394
}
14031395

14041396
#titles > button > div.count {
@@ -1895,12 +1887,7 @@ in storage.js plus the media query with (min-width: 701px)
18951887
}
18961888

18971889
#titles > button > div.count {
1898-
float: left;
1899-
width: 100%;
1900-
}
1901-
1902-
#titles {
1903-
height: 50px;
1890+
display: block;
19041891
}
19051892

19061893
/* Because of ios, we need to actually have a full height sidebar title so the
@@ -2031,10 +2018,6 @@ in storage.js plus the media query with (min-width: 701px)
20312018
}
20322019

20332020
@media (max-width: 464px) {
2034-
#titles, #titles > button {
2035-
height: 73px;
2036-
}
2037-
20382021
#crate-search {
20392022
border-radius: 4px;
20402023
}

0 commit comments

Comments
 (0)