Skip to content

Commit d99201c

Browse files
Rollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, r=GuillaumeGomez
rustdoc: use flexbox CSS to align sidebar button instead of position This accomplishes the same thing with significantly less code. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-toggle-flexbox/src/test_dingus/lib.rs.html
2 parents c4f8546 + 8b001b4 commit d99201c

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Diff for: src/librustdoc/html/static/css/rustdoc.css

+3-9
Original file line numberDiff line numberDiff line change
@@ -1327,8 +1327,8 @@ a.test-arrow:hover {
13271327
border-bottom: 1px solid;
13281328
display: flex;
13291329
height: 40px;
1330-
justify-content: center;
1331-
align-items: center;
1330+
justify-content: stretch;
1331+
align-items: stretch;
13321332
z-index: 10;
13331333
}
13341334
#source-sidebar {
@@ -1356,13 +1356,7 @@ a.test-arrow:hover {
13561356
text-align: center;
13571357
border: none;
13581358
outline: none;
1359-
position: absolute;
1360-
top: 0;
1361-
bottom: 0;
1362-
left: 0;
1363-
right: 0;
1364-
/* work around button layout strangeness: https://stackoverflow.com/q/7271561 */
1365-
width: 100%;
1359+
flex: 1 1;
13661360
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
13671361
-webkit-appearance: none;
13681362
opacity: 1;

0 commit comments

Comments
 (0)