Skip to content

Commit e6aef7b

Browse files
authored
Rollup merge of rust-lang#101812 - notriddle:notriddle/titles-button, r=GuillaumeGomez
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. # Before ![image](https://user-images.githubusercontent.com/1593513/190215034-253c0f58-07c6-41c9-8848-0442c0522070.png) # After ![image](https://user-images.githubusercontent.com/1593513/190215065-d2453dca-edf0-4353-8fc8-3a3b31f03892.png)
2 parents b71b640 + 44d9b8d commit e6aef7b

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
@@ -1365,27 +1365,19 @@ pre.rust {
13651365
}
13661366

13671367
#titles {
1368-
height: 35px;
1368+
display: flex;
1369+
flex-direction: row;
1370+
gap: 1px;
1371+
margin-bottom: 4px;
13691372
}
13701373

13711374
#titles > button {
1372-
float: left;
1373-
width: 33.3%;
13741375
text-align: center;
13751376
font-size: 1.125rem;
13761377
cursor: pointer;
13771378
border: 0;
13781379
border-top: 2px solid;
1379-
}
1380-
1381-
#titles > button:first-child:last-child {
1382-
margin-right: 1px;
1383-
width: calc(100% - 1px);
1384-
}
1385-
1386-
#titles > button:not(:last-child) {
1387-
margin-right: 1px;
1388-
width: calc(33.3% - 1px);
1380+
flex: 1;
13891381
}
13901382

13911383
#titles > button > div.count {
@@ -1882,12 +1874,7 @@ in storage.js plus the media query with (min-width: 701px)
18821874
}
18831875

18841876
#titles > button > div.count {
1885-
float: left;
1886-
width: 100%;
1887-
}
1888-
1889-
#titles {
1890-
height: 50px;
1877+
display: block;
18911878
}
18921879

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

20202007
@media (max-width: 464px) {
2021-
#titles, #titles > button {
2022-
height: 73px;
2023-
}
2024-
20252008
#crate-search {
20262009
border-radius: 4px;
20272010
}

0 commit comments

Comments
 (0)