From 626d7fc6133d5b3f24689114c0f605e8986e66ba Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 25 Oct 2022 10:43:08 -0700 Subject: [PATCH] rustdoc: combine shared CSS between `.*-line-numbers` --- src/librustdoc/html/static/css/rustdoc.css | 51 ++++++++-------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 173553ed47749..75b22f682a5f7 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -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; @@ -2024,10 +2015,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;