Skip to content

Commit 4907614

Browse files
author
Yuki Okushi
authoredOct 26, 2022
Rollup merge of #103537 - notriddle:notriddle/line-numbers, r=GuillaumeGomez
rustdoc: combine shared CSS between `.*-line-numbers` Example: https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html This PR should result in no visible changes. The example is here, so it can be easily tested in different browsers.
2 parents cafb63d + 626d7fc commit 4907614

File tree

1 file changed

+19
-32
lines changed

1 file changed

+19
-32
lines changed
 

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

+19-32
Original file line numberDiff line numberDiff line change
@@ -549,47 +549,38 @@ ul.block, .block li {
549549
margin-bottom: 0px;
550550
}
551551

552-
pre.example-line-numbers {
553-
overflow: initial;
554-
border: 1px solid;
555-
padding: 13px 8px;
556-
text-align: right;
557-
border-top-left-radius: 5px;
558-
border-bottom-left-radius: 5px;
559-
}
560-
561-
.src-line-numbers {
562-
text-align: right;
563-
}
564-
.rustdoc:not(.source) .example-wrap > pre:not(.example-line-numbers) {
565-
width: 100%;
566-
overflow-x: auto;
567-
}
568-
569-
.rustdoc:not(.source) .example-wrap > pre.src-line-numbers {
570-
width: auto;
571-
overflow-x: visible;
572-
}
573-
574552
.rustdoc .example-wrap > pre {
575553
margin: 0;
554+
flex-grow: 1;
555+
overflow-x: auto;
576556
}
577557

578-
.search-loading {
579-
text-align: center;
580-
}
581-
582-
.content > .example-wrap pre.src-line-numbers {
583-
position: relative;
558+
.rustdoc .example-wrap > pre.example-line-numbers,
559+
.rustdoc .example-wrap > pre.src-line-numbers {
560+
flex-grow: 0;
561+
overflow: initial;
562+
text-align: right;
584563
-webkit-user-select: none;
585564
-moz-user-select: none;
586565
-ms-user-select: none;
587566
user-select: none;
588567
}
568+
569+
.example-line-numbers {
570+
border: 1px solid;
571+
padding: 13px 8px;
572+
border-top-left-radius: 5px;
573+
border-bottom-left-radius: 5px;
574+
}
575+
589576
.src-line-numbers span {
590577
cursor: pointer;
591578
}
592579

580+
.search-loading {
581+
text-align: center;
582+
}
583+
593584
.docblock-short {
594585
overflow-wrap: break-word;
595586
overflow-wrap: anywhere;
@@ -2033,10 +2024,6 @@ in storage.js
20332024
padding-bottom: 0;
20342025
}
20352026

2036-
.scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
2037-
overflow-x: hidden;
2038-
}
2039-
20402027
.scraped-example .code-wrapper .prev {
20412028
position: absolute;
20422029
top: 0.25em;

0 commit comments

Comments
 (0)
Please sign in to comment.