Skip to content

Commit c8cddde

Browse files
committed
Auto merge of #27002 - IvanUkhov:docblock-pre-code, r=Gankro
The current nonzero side padding of `code` tags is good for legibility in paragraphs and lists; however, it introduces an awkward indentation to `pre` tags. Specifically, when a `pre` tag contains preformatted text with multiple lines, the fist line gets pushed slightly to the right, running the vertical alignment. An example can be seen [here](http://doc.rust-lang.org/std/fmt/#syntax). I propose setting the padding to zero for `code`s contained in `pre`s. Regards, Ivan
2 parents dd46cf8 + 71e7fee commit c8cddde

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustdoc/html/static/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ code, pre {
128128
border-radius: 3px;
129129
padding: 0 0.2em;
130130
}
131+
.docblock pre code {
132+
padding: 0;
133+
}
131134
pre {
132135
background-color: #F5F5F5;
133136
padding: 14px;

0 commit comments

Comments
 (0)