diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2024-12-05 23:47:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-05 23:47:07 +0100 |
| commit | a424813c4355cddc259dc5a9bb5083f602b0a684 (patch) | |
| tree | 34862b5d8b42988b3ebf39cc2bb5704b343b4ef8 /src/librustdoc/html/static/css | |
| parent | c94848c046d29f9a80c09aae758e27e418a289f2 (diff) | |
| parent | 854ebe7522ef3b91e708a45077bbcd8da061e876 (diff) | |
| download | rust-a424813c4355cddc259dc5a9bb5083f602b0a684.tar.gz rust-a424813c4355cddc259dc5a9bb5083f602b0a684.zip | |
Rollup merge of #132155 - GuillaumeGomez:impl-block-doc, r=rustdoc
Always display first line of impl blocks even when collapsed Fixes https://github.com/rust-lang/rust/issues/130612. It the line is too long, only the beginning will be visible:  Otherwise, it looks like this:  Can be tested [here](https://rustdoc.crud.net/imperio/impl-block-doc/foo/struct.ImplDoc.html). r? `@notriddle`
Diffstat (limited to 'src/librustdoc/html/static/css')
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 90aa5904daf..27496381b2c 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -2210,6 +2210,39 @@ details.toggle[open] > summary::after { content: "Collapse"; } +details.toggle:not([open]) > summary .docblock { + max-height: calc(1.5em + 0.75em); + overflow-y: hidden; +} +details.toggle:not([open]) > summary .docblock > :first-child { + max-width: 100%; + 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; + right: 0; + top: 0; + bottom: 0; + z-index: 1; + background-color: var(--main-background-color); + font: 1rem/1.5 "Source Serif 4", NanumBarunGothic, serif; + /* To make it look a bit better and not have it stuck to the preceding element. */ + padding-left: 0.2em; +} +details.toggle:not([open]) > summary .docblock > div:first-child::after { + /* This is to make the "..." always appear at the bottom. */ + padding-top: calc(1.5em + 0.75em - 1.2rem); +} + +details.toggle > summary .docblock { + margin-top: 0.75em; +} + /* This is needed in docblocks to have the "▶" element to be on the same line. */ .docblock summary > * { display: inline-block; |
