Skip to content

Commit 7979ae5

Browse files
committed
doc: CSS fixes
- fixup and refactor highlighting code - have a proper print stylesheet
1 parent 9eadcac commit 7979ae5

File tree

3 files changed

+32
-21
lines changed

3 files changed

+32
-21
lines changed

src/doc/rust.css

+24-10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ p {
7575
margin: 0 0 10px;
7676
}
7777

78+
strong {
79+
font-weight: bold;
80+
}
81+
82+
em {
83+
font-style: italic;
84+
}
85+
7886
footer {
7987
border-top: 1px solid #ddd;
8088
font-size: 12px;
@@ -107,6 +115,8 @@ a:hover, a:active {
107115
h1 a:link, h1 a:visited, h2 a:link, h2 a:visited,
108116
h3 a:link, h3 a:visited, h4 a:link, h4 a:visited,
109117
h5 a:link, h5 a:visited {color: black;}
118+
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
119+
h5 a:hover {text-decoration: none;}
110120

111121
/* Code
112122
========================================================================== */
@@ -144,16 +154,14 @@ pre code {
144154
/* Code highlighting */
145155
pre.rust .kw { color: #8959A8; }
146156
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
147-
pre.rust .number { color: #718C00; }
148-
pre.rust .self { color: #C13928; }
149-
pre.rust .boolval { color: #C13928; }
150-
pre.rust .prelude-val { color: #C13928; }
157+
pre.rust .number, pre.rust .string { color: #718C00; }
158+
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
159+
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
151160
pre.rust .comment { color: #8E908C; }
152161
pre.rust .doccomment { color: #4D4D4C; }
153-
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999f; }
154-
pre.rust .string { color: #718C00; }
155-
pre.rust .lifetime { color: #C13928; }
156-
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
162+
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
163+
pre.rust .lifetime { color: #B76514; }
164+
157165

158166
/* The rest
159167
========================================================================== */
@@ -162,7 +170,7 @@ pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
162170
margin: 0.5em;
163171
font-size: 1.1em;
164172
}
165-
@media (min-width: 768px) {
173+
@media only screen, handheld and (min-width: 768px) {
166174
#versioninfo {
167175
position: fixed;
168176
bottom: 0px;
@@ -262,9 +270,12 @@ table th {
262270
a, a:visited {
263271
text-decoration: underline;
264272
}
265-
a[href]:after {
273+
p a[href]:after {
266274
content: " (" attr(href) ")";
267275
}
276+
footer a[href]:after {
277+
content: "";
278+
}
268279
a[href^="javascript:"]:after, a[href^="#"]:after {
269280
content: "";
270281
}
@@ -275,6 +286,9 @@ table th {
275286
@page {
276287
margin: 2cm .5cm;
277288
}
289+
h1:not(.title), h2, h3 {
290+
border-bottom: 0px none;
291+
}
278292
p, h2, h3 {
279293
orphans: 3;
280294
widows: 3;

src/librustdoc/html/static/main.css

+7-10
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ nav.sub {
126126
.content pre.line-numbers { float: left; border: none; }
127127
.line-numbers span { color: #c67e2d; }
128128
.line-numbers .line-highlighted {
129-
background-color: #fff871;
129+
background-color: #f6fdb0;
130130
}
131131

132132
.content .highlighted {
@@ -306,19 +306,16 @@ a {
306306

307307
pre.rust, pre.line-numbers { background-color: #FDFDFD; }
308308

309-
/* Code Highlighting */
309+
/* Code highlighting */
310310
pre.rust .kw { color: #8959A8; }
311311
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
312-
pre.rust .number { color: #718C00; }
313-
pre.rust .self { color: #C13928; }
314-
pre.rust .boolval { color: #C13928; }
315-
pre.rust .prelude-val { color: #C13928; }
312+
pre.rust .number, pre.rust .string { color: #718C00; }
313+
pre.rust .self, pre.rust .boolval, pre.rust .prelude-val,
314+
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
316315
pre.rust .comment { color: #8E908C; }
317316
pre.rust .doccomment { color: #4D4D4C; }
318-
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999f; }
319-
pre.rust .string { color: #718C00; }
320-
pre.rust .lifetime { color: #C13928; }
321-
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
317+
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
318+
pre.rust .lifetime { color: #B76514; }
322319

323320
h1:hover a:after,
324321
h2:hover a:after,

src/librustdoc/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches) -> int
117117

118118
let err = write!(
119119
&mut out,
120-
r#"<!doctype html>
120+
r#"<!DOCTYPE html>
121121
<html lang="en">
122122
<head>
123123
<meta charset="utf-8">

0 commit comments

Comments
 (0)