Skip to content

Commit

Permalink
Rollup merge of #103537 - notriddle:notriddle/line-numbers, r=Guillau…
Browse files Browse the repository at this point in the history
…meGomez

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.
  • Loading branch information
Yuki Okushi committed Oct 26, 2022
2 parents cafb63d + 626d7fc commit 4907614
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions src/librustdoc/html/static/css/rustdoc.css
Expand Up @@ -549,47 +549,38 @@ ul.block, .block li {
margin-bottom: 0px;
}

pre.example-line-numbers {
overflow: initial;
border: 1px solid;
padding: 13px 8px;
text-align: right;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}

.src-line-numbers {
text-align: right;
}
.rustdoc:not(.source) .example-wrap > pre:not(.example-line-numbers) {
width: 100%;
overflow-x: auto;
}

.rustdoc:not(.source) .example-wrap > pre.src-line-numbers {
width: auto;
overflow-x: visible;
}

.rustdoc .example-wrap > pre {
margin: 0;
flex-grow: 1;
overflow-x: auto;
}

.search-loading {
text-align: center;
}

.content > .example-wrap pre.src-line-numbers {
position: relative;
.rustdoc .example-wrap > pre.example-line-numbers,
.rustdoc .example-wrap > pre.src-line-numbers {
flex-grow: 0;
overflow: initial;
text-align: right;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.example-line-numbers {
border: 1px solid;
padding: 13px 8px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}

.src-line-numbers span {
cursor: pointer;
}

.search-loading {
text-align: center;
}

.docblock-short {
overflow-wrap: break-word;
overflow-wrap: anywhere;
Expand Down Expand Up @@ -2033,10 +2024,6 @@ in storage.js
padding-bottom: 0;
}

.scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
overflow-x: hidden;
}

.scraped-example .code-wrapper .prev {
position: absolute;
top: 0.25em;
Expand Down

0 comments on commit 4907614

Please sign in to comment.