diff options
| author | Michael Howell <michael@notriddle.com> | 2024-09-03 14:25:40 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2024-09-10 17:56:17 -0700 |
| commit | df307d00852cdd0a23dfe7e981f3ad6aee7eda8a (patch) | |
| tree | eb92d3c38106e88705579874c9db6f1bfdd367d7 | |
| parent | 5b1b2e97e36c4966b9c6c30d5679f6da76503fc7 (diff) | |
| download | rust-df307d00852cdd0a23dfe7e981f3ad6aee7eda8a.tar.gz rust-df307d00852cdd0a23dfe7e981f3ad6aee7eda8a.zip | |
rustdoc: tweak spacing in toolbar
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 12 | ||||
| -rw-r--r-- | tests/rustdoc-gui/item-info.goml | 2 | ||||
| -rw-r--r-- | tests/rustdoc-gui/scrape-examples-layout.goml | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index fe5d35cad49..2dfe5107210 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -34,6 +34,8 @@ xmlns="http://www.w3.org/2000/svg" fill="black" height="18px">\ </g></svg>'); --button-left-margin: 4px; --button-border-radius: 2px; + --toolbar-button-border-radius: 6px; + --code-block-border-radius: 6px; } /* See FiraSans-LICENSE.txt for the Fira Sans license. */ @@ -183,7 +185,7 @@ h1, h2, h3, h4 { grid-template-columns: 1fr max-content; grid-template-rows: 25px min-content min-content; padding-bottom: 6px; - margin-bottom: 15px; + margin-bottom: 11px; } .rustdoc-breadcrumbs { grid-area: main-heading-breadcrumbs; @@ -904,6 +906,7 @@ both the code example and the line numbers, so we need to remove the radius in t flex-grow: 0; grid-area: main-heading-sub-heading; line-height: 1.25; + padding-bottom: 4px; } .main-heading rustdoc-toolbar, .main-heading .out-of-band { @@ -918,6 +921,7 @@ rustdoc-toolbar { .docblock code, .docblock-short code, pre, .rustdoc.src .example-wrap { background-color: var(--code-block-background-color); + border-radius: var(--code-block-border-radius); } #main-content { @@ -1315,14 +1319,14 @@ so that we can apply CSS-filters to change the arrow color in themes */ #settings.popover { --popover-arrow-offset: 202px; - top: calc(100% - 12px); + top: calc(100% - 16px); } /* use larger max-width for help popover, but not for help.html */ #help.popover { max-width: 600px; --popover-arrow-offset: 118px; - top: calc(100% - 12px); + top: calc(100% - 16px); } #help dt { @@ -1838,6 +1842,7 @@ a.tooltip:hover::after { } #settings-menu > a, #help-button > a, button#toggle-all-docs { width: 80px; + border-radius: var(--toolbar-button-border-radius); } #sidebar-button > a { background-color: var(--button-background-color); @@ -1924,6 +1929,7 @@ button[disabled]#toggle-all-docs:hover { rustdoc-toolbar span.label { font-size: 1rem; flex-grow: 1; + padding-bottom: 4px; } #sidebar-button > a:before { diff --git a/tests/rustdoc-gui/item-info.goml b/tests/rustdoc-gui/item-info.goml index 2824a571140..c8aa7b31cad 100644 --- a/tests/rustdoc-gui/item-info.goml +++ b/tests/rustdoc-gui/item-info.goml @@ -20,7 +20,7 @@ store-position: ( {"x": second_line_x, "y": second_line_y}, ) assert: |first_line_x| != |second_line_x| && |first_line_x| == 516 && |second_line_x| == 272 -assert: |first_line_y| != |second_line_y| && |first_line_y| == 710 && |second_line_y| == 733 +assert: |first_line_y| != |second_line_y| && |first_line_y| == 714 && |second_line_y| == 737 // Now we ensure that they're not rendered on the same line. set-window-size: (1100, 800) diff --git a/tests/rustdoc-gui/scrape-examples-layout.goml b/tests/rustdoc-gui/scrape-examples-layout.goml index 803e8e499f4..2bf2f10a215 100644 --- a/tests/rustdoc-gui/scrape-examples-layout.goml +++ b/tests/rustdoc-gui/scrape-examples-layout.goml @@ -72,8 +72,8 @@ click: ".scraped-example .button-holder .expand" store-value: (offset_y, 4) // First with desktop -assert-position: (".scraped-example", {"y": 248}) -assert-position: (".scraped-example .prev", {"y": 248 + |offset_y|}) +assert-position: (".scraped-example", {"y": 252}) +assert-position: (".scraped-example .prev", {"y": 252 + |offset_y|}) // Gradient background should be at the top of the code block. assert-css: (".scraped-example .example-wrap::before", {"top": "0px"}) @@ -82,8 +82,8 @@ assert-css: (".scraped-example .example-wrap::after", {"bottom": "0px"}) // Then with mobile set-window-size: (600, 600) store-size: (".scraped-example .scraped-example-title", {"height": title_height}) -assert-position: (".scraped-example", {"y": 277}) -assert-position: (".scraped-example .prev", {"y": 277 + |offset_y| + |title_height|}) +assert-position: (".scraped-example", {"y": 281}) +assert-position: (".scraped-example .prev", {"y": 281 + |offset_y| + |title_height|}) define-function: ( "check_title_and_code_position", |
