diff options
| author | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2022-01-21 17:44:54 -0800 |
|---|---|---|
| committer | Jacob Hoffman-Andrews <github@hoffman-andrews.com> | 2022-01-29 17:13:14 -0800 |
| commit | a998a374769f80e08fb7e1269b6fcd886ce453cf (patch) | |
| tree | f92b488e7f25662c0cb52135c444795220d70c46 /src/librustdoc/html/static/css/rustdoc.css | |
| parent | a00e130dae74a213338e2b095ec855156d8f3d8a (diff) | |
| download | rust-a998a374769f80e08fb7e1269b6fcd886ce453cf.tar.gz rust-a998a374769f80e08fb7e1269b6fcd886ce453cf.zip | |
rustdoc: small fixes to mobile navigation
- Make sure the mobile-topbar doesn't overflow its height if the user sets a bigger font. - Make sure the sidebar can be scrolled all the way to the bottom by shortening it to accommodate the mobile-topbar. - Make the item name in the mobile-topbar clickable to go to the top of the page. - Remove excess padding sidebar in mobile mode.
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 4c79218f62a..87403a8b834 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1799,8 +1799,9 @@ details.rustdoc-toggle[open] > summary.hideme::after { background-color: rgba(0,0,0,0); margin: 0; padding: 0; - padding-left: 15px; z-index: 11; + /* Reduce height slightly to account for mobile topbar. */ + height: calc(100vh - 45px); } /* The source view uses a different design for the sidebar toggle, and doesn't have a topbar, @@ -1831,7 +1832,13 @@ details.rustdoc-toggle[open] > summary.hideme::after { padding: 0.3em; padding-right: 0.6em; text-overflow: ellipsis; - overflow-x: hidden; + overflow: hidden; + white-space: nowrap; + /* Rare exception to specifying font sizes in rem. Since the topbar + height is specified in pixels, this also has to be specified in + pixels to avoid overflowing the topbar when the user sets a bigger + font size. */ + font-size: 22.4px; } .mobile-topbar .logo-container { @@ -1864,6 +1871,9 @@ details.rustdoc-toggle[open] > summary.hideme::after { .sidebar-menu-toggle { width: 45px; + /* Rare exception to specifying font sizes in rem. Since this is acting + as an icon, it's okay to specify its sizes in pixels. */ + font-size: 32px; border: none; } |
