Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: combine shared CSS between .*-line-numbers #103537

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 19 additions & 32 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
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 @@ -2024,10 +2015,6 @@ in storage.js
padding-bottom: 0;
}

.scraped-example:not(.expanded) .code-wrapper pre.src-line-numbers {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why it was hidden until now. In your test doc file it works just as expected though so all good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like used to be used to this functionality:

image

However, ever since the implementation was changed to limit the height of the wrapper div instead of the pre themselves, it doesn't matter.

I uploaded a new test-dingus with example files big enough to require expanding. Open https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html and you'll see what it looks like.

overflow-x: hidden;
}

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