diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2023-04-06 07:18:32 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-06 07:18:32 +0900 |
| commit | 9960e9f851a314dc3b241c26b09f4e1c4d7717b9 (patch) | |
| tree | fca1c0cb846ccf1d5c0e798413a17bc68e88463e | |
| parent | fe20ae035814636177b283bfa3447d17b73c4755 (diff) | |
| parent | 8f5404d0d79f7cef9445b531aae5394fe3b22f29 (diff) | |
| download | rust-9960e9f851a314dc3b241c26b09f4e1c4d7717b9.tar.gz rust-9960e9f851a314dc3b241c26b09f4e1c4d7717b9.zip | |
Rollup merge of #109973 - GuillaumeGomez:logo-display-very-small-screen, r=notriddle
rustdoc: Improve logo display very small screen Before:  After:  r? `@notriddle`
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 7 | ||||
| -rw-r--r-- | tests/rustdoc-gui/huge-logo.goml | 4 | ||||
| -rw-r--r-- | tests/rustdoc-gui/source-code-page.goml | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 726394d8348..e86eaa65b75 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -6,6 +6,10 @@ 3. Copy the filenames with updated suffixes from the directory. */ +:root { + --nav-sub-mobile-padding: 8px; +} + /* See FiraSans-LICENSE.txt for the Fira Sans license. */ @font-face { font-family: 'Fira Sans'; @@ -1726,7 +1730,7 @@ in main.js .source nav.sub { margin: 0; - padding: 8px; + padding: var(--nav-sub-mobile-padding); } } @@ -1783,6 +1787,7 @@ in main.js .sub-logo-container > img { height: 35px; width: 35px; + margin-bottom: var(--nav-sub-mobile-padding); } } diff --git a/tests/rustdoc-gui/huge-logo.goml b/tests/rustdoc-gui/huge-logo.goml index 01f06771c15..69459bd3e23 100644 --- a/tests/rustdoc-gui/huge-logo.goml +++ b/tests/rustdoc-gui/huge-logo.goml @@ -18,4 +18,6 @@ size: (1280, 1024) assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60}) size: (400, 600) -assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35}) +// 43 because 35px + 8px of margin +assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) +assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 43}) diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index 7c35119e695..ea6ff12328c 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -216,3 +216,8 @@ call-function: ("check-sidebar-dir-entry", { "x": 0, "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 6, }) + +// Now we check that the logo has a bottom margin so it's not stuck to the search input. +assert-css: (".sub-logo-container > img", {"margin-bottom": "8px"}) +store-property: (logo_height, ".sub-logo-container", "clientHeight") +assert-position: (".search-form", {"y": |logo_height| + 8}) |
