Skip to content

Commit

Permalink
Use text ellipsis instead of bottom blurring
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 29, 2024
1 parent 391c707 commit 4fc3871
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -2187,20 +2187,25 @@ details.toggle:not([open]) > summary .docblock {
max-height: calc(1.5em + 0.75em);
overflow-y: hidden;
}
details.toggle:not([open]) > summary .docblock::after {
content: '';
details.toggle:not([open]) > summary .docblock > :first-child {
max-width: calc(100% - 1em);
overflow: hidden;
width: fit-content;
white-space: nowrap;
position: relative;
padding-right: 1em;
}
details.toggle:not([open]) > summary .docblock > :first-child::after {
content: "…";
position: absolute;
bottom: 0;
left: 0;
right: 0;
pointer-events: none;
background: linear-gradient(
to top,
var(--scrape-example-code-wrapper-background-start),
var(--scrape-example-code-wrapper-background-end)
);
height: 0.7em;
top: 0;
bottom: 0;
z-index: 1;
background-color: var(--main-background-color);
/* In case this ends up in a heading or a `<code>` item. */
font-weight: normal;
font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif;
}
details.toggle > summary .docblock {
margin-top: 0.75em;
Expand Down

0 comments on commit 4fc3871

Please sign in to comment.