about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonasschievink@gmail.com>2021-01-31 01:47:44 +0100
committerGitHub <noreply@github.com>2021-01-31 01:47:44 +0100
commit45d24c729c41a8ec737dbfe0b79c67e943d37e7f (patch)
treee46737df0edf7ce25b6d6a380e0edf9f39c2ca0a
parent635dbd60bfd0a19f9d39e8da45343e3340f910ea (diff)
parent6d7ef10b4662fcd76cac9ca81568fcd26136b4db (diff)
downloadrust-45d24c729c41a8ec737dbfe0b79c67e943d37e7f.tar.gz
rust-45d24c729c41a8ec737dbfe0b79c67e943d37e7f.zip
Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomez
Fix ascii art text wrapping in mobile

Fix #81377

Before

![image](https://user-images.githubusercontent.com/4687791/106362405-a1a53800-635d-11eb-87b9-2f40bbd023bf.png)
![image](https://user-images.githubusercontent.com/4687791/106362410-aa960980-635d-11eb-96ee-979251b213a3.png)
![image](https://user-images.githubusercontent.com/4687791/106362562-80911700-635e-11eb-97ee-b19a6ea2fc6d.png)

After

![image](https://user-images.githubusercontent.com/4687791/106362428-b4b80800-635d-11eb-8d5b-e4f51f5501ee.png)
![image](https://user-images.githubusercontent.com/4687791/106362433-bbdf1600-635d-11eb-96af-7043c74b3a0a.png)
![image](https://user-images.githubusercontent.com/4687791/106362570-8f77c980-635e-11eb-928d-ef1d26c13136.png)

Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.
-rw-r--r--src/librustdoc/html/static/rustdoc.css3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 8dad26dced9..644a186ff16 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -156,6 +156,7 @@ code, pre, a.test-arrow {
 }
 .docblock pre code, .docblock-short pre code, .docblock code.spotlight {
 	padding: 0;
+	padding-right: 1ex;
 }
 .docblock code.spotlight :last-child {
 	padding-bottom: 0.6em;
@@ -404,7 +405,7 @@ nav.sub {
 	text-overflow: ellipsis;
 	margin: 0;
 }
-.docblock code, .docblock-short code {
+.docblock-short code {
 	white-space: pre-wrap;
 }