about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-05-31 22:17:13 +0200
committerGitHub <noreply@github.com>2018-05-31 22:17:13 +0200
commit8efecc110266dd614503f0a8b9c1a31d5b52a144 (patch)
tree15ebc3f21bc8e5e060c4191f3ca90682cdfcbcbe
parenta729d97848c5716755e0862f54e3215e3224c4dd (diff)
parentc7312fbae4979c6d4fdfbd1f55a71cd47d82a480 (diff)
Rollup merge of #51193 - GuillaumeGomez:fixes-style-issues, r=QuietMisdreavus
Fixes some style issues in rustdoc "implementations on Foreign types"

Fixes #51113.

r? @QuietMisdreavus
-rw-r--r--src/librustdoc/html/static/main.js10
-rw-r--r--src/librustdoc/html/static/rustdoc.css23
-rw-r--r--src/librustdoc/html/static/themes/dark.css4
-rw-r--r--src/librustdoc/html/static/themes/light.css4
4 files changed, 33 insertions, 8 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index e0235bfc694..bb9a7e47232 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -1979,7 +1979,7 @@
         onEach(e.getElementsByClassName('associatedconstant'), func);
     });
 
-    function createToggle(otherMessage) {
+    function createToggle(otherMessage, extraClass) {
         var span = document.createElement('span');
         span.className = 'toggle-label';
         span.style.display = 'none';
@@ -1995,6 +1995,9 @@
 
         var wrapper = document.createElement('div');
         wrapper.className = 'toggle-wrapper';
+        if (extraClass) {
+            wrapper.className += ' ' + extraClass;
+        }
         wrapper.appendChild(mainToggle);
         return wrapper;
     }
@@ -2023,10 +2026,13 @@
         }
         if (e.parentNode.id === "main") {
             var otherMessage;
+            var extraClass;
             if (hasClass(e, "type-decl")) {
                 otherMessage = '&nbsp;Show&nbsp;declaration';
+            } else if (hasClass(e.childNodes[0], "impl-items")) {
+                extraClass = "marg-left";
             }
-            e.parentNode.insertBefore(createToggle(otherMessage), e);
+            e.parentNode.insertBefore(createToggle(otherMessage, extraClass), e);
             if (otherMessage && getCurrentValue('rustdoc-item-declarations') !== "false") {
                 collapseDocs(e.previousSibling.childNodes[0], "toggle");
             }
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 4939505c531..83abf35c854 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -474,11 +474,30 @@ h4 > code, h3 > code, .invisible > code {
 	margin-bottom: 15px;
 }
 
+.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
+	margin-left: 20px;
+}
 .content .impl-items .docblock, .content .impl-items .stability {
 	margin-bottom: .6em;
 }
-.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
+.content .docblock > .impl-items {
 	margin-left: 20px;
+	margin-top: -34px;
+}
+.content .docblock > .impl-items > h4 {
+	border-bottom: 0;
+}
+.content .docblock >.impl-items .table-display {
+	margin: 0;
+}
+.content .docblock >.impl-items table td {
+	padding: 0;
+}
+.toggle-wrapper.marg-left > .collapse-toggle {
+	left: -24px;
+}
+.content .docblock > .impl-items .table-display, .impl-items table td {
+	border: none;
 }
 
 .content .stability code {
@@ -542,7 +561,7 @@ a {
 	content: '\2002\00a7\2002';
 }
 
-.docblock a:hover, .docblock-short a:hover, .stability a {
+.docblock a:not(.srclink):hover, .docblock-short a:not(.srclink):hover, .stability a {
 	text-decoration: underline;
 }
 
diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css
index 493a75e2521..765ef0cd415 100644
--- a/src/librustdoc/html/static/themes/dark.css
+++ b/src/librustdoc/html/static/themes/dark.css
@@ -33,7 +33,7 @@ h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.t
 	background: rgba(0, 0, 0, 0);
 }
 
-.docblock code, .docblock-short code {
+.docblock p > code, .docblock-short p > code {
 	background-color: #2A2A2A;
 }
 pre {
@@ -163,7 +163,7 @@ a {
 	color: #ddd;
 }
 
-.docblock a, .docblock-short a, .stability a {
+.docblock a:not(.srclink), .docblock-short a:not(.srclink), .stability a {
 	color: #D2991D;
 }
 
diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css
index 22f4635fb02..5971dc43ded 100644
--- a/src/librustdoc/html/static/themes/light.css
+++ b/src/librustdoc/html/static/themes/light.css
@@ -35,7 +35,7 @@ h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.t
 	background: rgba(0, 0, 0, 0);
 }
 
-.docblock code, .docblock-short code {
+.docblock p > code, .docblock-short p > code {
 	background-color: #F5F5F5;
 }
 pre {
@@ -163,7 +163,7 @@ a {
 	color: #000;
 }
 
-.docblock a, .docblock-short a, .stability a {
+.docblock a:not(.srclink), .docblock-short a:not(.srclink), .stability a {
 	color: #3873AD;
 }