summary refs log tree commit diff
path: root/src/librustdoc/html/static/css/rustdoc.css
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-07-17 10:55:33 -0700
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-08-03 14:35:38 +0200
commit59460a655643b32fe2e1ac39279333bf5a574a82 (patch)
tree74b7db6d7193369715c00246da997f25c0f89cb6 /src/librustdoc/html/static/css/rustdoc.css
parentc58246efe47bea09d4f3e70f536e4c9bb7770749 (diff)
downloadrust-59460a655643b32fe2e1ac39279333bf5a574a82.tar.gz
rust-59460a655643b32fe2e1ac39279333bf5a574a82.zip
Pull the "Expand" / "Collapse" text to the end of the line, instead of start
Diffstat (limited to 'src/librustdoc/html/static/css/rustdoc.css')
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index ae321be09e2..531484f2105 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1508,10 +1508,7 @@ details.rustdoc-toggle > summary.hideme > span {
 }
 
 details.rustdoc-toggle > summary::before {
-	content: "Expand";
-	font-weight: 300;
-	font-size: 0.8em;
-	letter-spacing: 1px;
+	content: " ";
 	cursor: pointer;
 	width: 17px;
 	height: max(17px, 1.1em);
@@ -1519,13 +1516,21 @@ details.rustdoc-toggle > summary::before {
 	display: inline-block;
 	vertical-align: middle;
 	opacity: .5;
-	text-indent: 17px;
+}
+
+/* Screen readers see the text version at the end the line.
+	Visual readers see the icon at the start of the line, but small and transparent. */
+details.rustdoc-toggle > summary::after {
+	content: "Expand";
 	overflow: hidden;
+	width: 0;
+	height: 0;
+	position: absolute;
 }
 
-details.rustdoc-toggle > summary.hideme::before {
+details.rustdoc-toggle > summary.hideme::after {
 	/* "hideme" toggles already have a description when they're contracted */
-	content: " ";
+	content: "";
 }
 
 details.rustdoc-toggle > summary:focus::before {
@@ -1588,6 +1593,11 @@ details.rustdoc-toggle[open] > summary.hideme::before {
 	height: max(17px, 1.1em);
 	background: data-url(minus-17x17.png) no-repeat top left;
 	display: inline-block;
+	content: " ";
+}
+
+details.rustdoc-toggle[open] > summary::after,
+details.rustdoc-toggle[open] > summary.hideme::after {
 	content: "Collapse";
 }