From ded0bf5f9b38b5b07560c2cdecfeb41b9cc3bda9 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 6 Oct 2018 18:51:56 +0200 Subject: [PATCH] Fix mobile doc display --- src/librustdoc/html/render.rs | 5 ++-- src/librustdoc/html/static/rustdoc.css | 37 +++++++++++++++++--------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 1c61e73fae03c..23f1e15de3c92 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -4098,12 +4098,13 @@ impl<'a> fmt::Display for Sidebar<'a> { ", version)?; } + } + write!(fmt, "
")?; + if it.is_crate() { write!(fmt, "

See all {}'s items

", it.name.as_ref().expect("crates always have a name"))?; } - - write!(fmt, "
")?; match it.inner { clean::StructItem(ref s) => sidebar_struct(fmt, it, s)?, clean::TraitItem(ref t) => sidebar_trait(fmt, it, t)?, diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index ee811f3379239..c9e27dba479ad 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -909,10 +909,9 @@ span.since { padding-top: 0px; } - .sidebar { + body > .sidebar { height: 45px; min-height: 40px; - width: calc(100% + 30px); margin: 0; margin-left: -15px; padding: 0 15px; @@ -1014,6 +1013,10 @@ span.since { .anchor { display: none !important; } + + h1.fqn { + overflow: initial; + } } @media print { @@ -1113,6 +1116,18 @@ h4 > .important-traits { top: 2px; } +#all-types { + text-align: center; + border: 1px solid; + margin: 0 10px; + margin-bottom: 10px; + display: block; + border-radius: 7px; +} +#all-types > p { + margin: 5px 0; +} + @media (max-width: 700px) { h4 > .important-traits { position: absolute; @@ -1136,6 +1151,9 @@ h4 > .important-traits { background-color: rgba(0,0,0,0); height: 100%; } + .sidebar { + width: calc(100% + 30px); + } .show-it { display: block; @@ -1181,6 +1199,10 @@ h4 > .important-traits { .impl > .collapse-toggle { left: -10px; } + + #all-types { + margin: 10px; + } } @@ -1384,17 +1406,6 @@ kbd { #main > ul > li { list-style: none; } -#all-types { - text-align: center; - border: 1px solid; - margin: 0 10px; - margin-bottom: 10px; - display: block; - border-radius: 7px; -} -#all-types > p { - margin: 5px 0; -} .non-exhaustive { margin-bottom: 1em;