about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-05-09 12:50:21 -0700
committerManish Goregaokar <manishsmail@gmail.com>2016-05-09 14:59:36 -0700
commitc45d4816ca1e53afd57a3140daca7ee46f34672c (patch)
tree10055f7150d8bdc5a1694f21634c91c232830021
parent57fa783d3c184b193ae737d26bb5aecab7937d4d (diff)
parentcdca0843779eed0b9046e9fee48c91458ad51605 (diff)
downloadrust-c45d4816ca1e53afd57a3140daca7ee46f34672c.tar.gz
rust-c45d4816ca1e53afd57a3140daca7ee46f34672c.zip
Rollup merge of #33431 - GuillaumeGomez:issue-30416, r=steveklabnik
Update CSS for future rustdoc merge

cc #33382

r? @steveklabnik
cc @Manishearth
cc @birkenfeld
-rw-r--r--src/librustdoc/html/render.rs9
-rw-r--r--src/librustdoc/html/static/rustdoc.css43
-rw-r--r--src/librustdoc/html/static/styles/main.css3
3 files changed, 48 insertions, 7 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index a3200e69e3c..79c4b18211e 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -2144,7 +2144,7 @@ fn render_stability_since_raw<'a>(w: &mut fmt::Formatter,
                                   containing_ver: Option<&'a str>) -> fmt::Result {
     if let Some(v) = ver {
         if containing_ver != ver && v.len() > 0 {
-            write!(w, "<span class=\"since\">{}</span>",
+            write!(w, "<div class=\"since\">{}</div>",
                    v)?
         }
     }
@@ -2545,13 +2545,16 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
                render_header: bool, outer_version: Option<&str>) -> fmt::Result {
     if render_header {
         write!(w, "<h3 class='impl'><span class='in-band'><code>{}</code>", i.inner_impl())?;
-        let since = i.impl_item.stability.as_ref().map(|s| &s.since[..]);
-        render_stability_since_raw(w, since, outer_version)?;
         write!(w, "</span><span class='out-of-band'>")?;
+        let since = i.impl_item.stability.as_ref().map(|s| &s.since[..]);
         if let Some(l) = (Item { item: &i.impl_item, cx: cx }).href() {
+            write!(w, "<div class='ghost'></div>")?;
+            render_stability_since_raw(w, since, outer_version)?;
             write!(w, "<a id='src-{}' class='srclink' \
                        href='{}' title='{}'>[src]</a>",
                    i.impl_item.def_id.index.as_usize(), l, "goto source code")?;
+        } else {
+            render_stability_since_raw(w, since, outer_version)?;
         }
         write!(w, "</span>")?;
         write!(w, "</h3>\n")?;
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index c07871a4029..4d65b91ed42 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -97,6 +97,7 @@ h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):no
 h1.fqn {
     border-bottom: 1px dashed;
     margin-top: 0;
+    position: relative;
 }
 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
     border-bottom: 1px solid;
@@ -105,6 +106,7 @@ h3.impl, h3.method, h4.method, h3.type, h4.type {
     font-weight: 600;
     margin-top: 10px;
     margin-bottom: 10px;
+    position: relative;
 }
 h3.impl, h3.method, h3.type {
     margin-top: 15px;
@@ -265,20 +267,39 @@ nav.sub {
 
 .content .out-of-band {
     font-size: 23px;
-    width: 40%;
     margin: 0px;
     padding: 0px;
     text-align: right;
     display: inline-block;
+    font-weight: normal;
+    position: absolute;
+    right: 0;
+}
+
+h3.impl > .out-of-band {
+    font-size: 21px;
+}
+
+h4 > code, h3 > code {
+    position: inherit;
+}
+
+.in-band, code {
+    z-index: 5;
 }
 
 .content .in-band {
-    width: 60%;
     margin: 0px;
     padding: 0px;
     display: inline-block;
 }
 
+#main { position: relative; }
+#main > .since {
+    top: inherit;
+    font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
 .content table {
     border-spacing: 0 5px;
     border-collapse: separate;
@@ -498,11 +519,13 @@ em.stab p {
     opacity: 0.65;
 }
 
-span.since {
-    float: right;
+.since {
     font-weight: normal;
     font-size: initial;
     color: grey;
+    position: absolute;
+    right: 0;
+    top: 0;
 }
 
 .variants_table {
@@ -597,7 +620,19 @@ a.test-arrow {
     color: #999;
 }
 
+.ghost {
+    display: none;
+}
+
+.ghost + .since {
+    position: initial;
+    display: table-cell;
+}
 
+.since + .srclink {
+    display: table-cell;
+    padding-left: 10px;
+}
 
 /* Media Queries */
 
diff --git a/src/librustdoc/html/static/styles/main.css b/src/librustdoc/html/static/styles/main.css
index 5c073860f08..59b2ff7e3d6 100644
--- a/src/librustdoc/html/static/styles/main.css
+++ b/src/librustdoc/html/static/styles/main.css
@@ -26,6 +26,9 @@ h1.fqn {
 h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
     border-bottom-color: #DDDDDD;
 }
+.in-band, code {
+    background-color: white;
+}
 
 .docblock code {
     background-color: #F5F5F5;