Skip to content

Commit 55de547

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#40278 - GuillaumeGomez:css-cleanup, r=frewsxcv
Clean up rustdoc css r? @rust-lang/docs
2 parents 270cde9 + 4078b25 commit 55de547

File tree

2 files changed

+89
-58
lines changed

2 files changed

+89
-58
lines changed

src/librustdoc/html/static/rustdoc.css

+6-27
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,13 @@ h4 > code, h3 > code, .invisible > code {
377377
.content .method .where,
378378
.content .fn .where,
379379
.content .where.fmt-newline {
380-
display: block;
380+
display: block;
381381
}
382382
/* Bit of whitespace to indent it */
383383
.content .method .where::before,
384384
.content .fn .where::before,
385385
.content .where.fmt-newline::before {
386-
content: ' ';
386+
content: ' ';
387387
}
388388

389389
.content .methods > div { margin-left: 40px; }
@@ -506,17 +506,15 @@ body.blur > :not(#help) {
506506
}
507507
#help > div {
508508
flex: 0 0 auto;
509-
background: #e9e9e9;
510509
box-shadow: 0 0 6px rgba(0,0,0,.2);
511510
width: 550px;
512511
height: 330px;
513-
border: 1px solid #bfbfbf;
512+
border: 1px solid;
514513
}
515514
#help dt {
516515
float: left;
517516
border-radius: 4px;
518-
border: 1px solid #bfbfbf;
519-
background: #fff;
517+
border: 1px solid;
520518
width: 23px;
521519
text-align: center;
522520
clear: left;
@@ -567,7 +565,6 @@ body.blur > :not(#help) {
567565
.since {
568566
font-weight: normal;
569567
font-size: initial;
570-
color: grey;
571568
position: absolute;
572569
right: 0;
573570
top: 0;
@@ -589,24 +586,12 @@ td.summary-column {
589586
padding-right: 0px;
590587
}
591588

592-
.line-numbers :target { background-color: transparent; }
593-
594-
/* Code highlighting */
595-
pre.rust .kw { color: #8959A8; }
596-
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
597-
pre.rust .number, pre.rust .string { color: #718C00; }
598-
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
599-
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
600-
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
601-
pre.rust .lifetime { color: #B76514; }
602589
pre.rust .question-mark {
603-
color: #ff9011;
604590
font-weight: bold;
605591
}
606592

607593
pre.rust { position: relative; }
608594
a.test-arrow {
609-
background-color: rgba(78, 139, 202, 0.2);
610595
display: inline-block;
611596
position: absolute;
612597
padding: 5px 10px 5px 10px;
@@ -616,7 +601,6 @@ a.test-arrow {
616601
right: 5px;
617602
}
618603
a.test-arrow:hover{
619-
background-color: #4e8bca;
620604
text-decoration: none;
621605
}
622606

@@ -660,10 +644,6 @@ a.test-arrow:hover{
660644
text-align: center;
661645
}
662646

663-
.toggle-label {
664-
color: #999;
665-
}
666-
667647
.ghost {
668648
display: none;
669649
}
@@ -719,8 +699,7 @@ span.since {
719699
}
720700

721701
:target > code {
722-
background: #FDFFD3;
723-
opacity: 1;
702+
opacity: 1;
724703
}
725704

726705
/* Media Queries */
@@ -793,4 +772,4 @@ span.since {
793772
nav.sub, .content .out-of-band, .collapse-toggle {
794773
display: none;
795774
}
796-
}
775+
}

src/librustdoc/html/static/styles/main.css

+83-31
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,36 @@
1313
/* General structure and fonts */
1414

1515
body {
16-
background-color: white;
17-
color: black;
16+
background-color: white;
17+
color: black;
1818
}
1919

2020
h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
21-
color: black;
21+
color: black;
2222
}
2323
h1.fqn {
24-
border-bottom-color: #D5D5D5;
24+
border-bottom-color: #D5D5D5;
2525
}
2626
h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
27-
border-bottom-color: #DDDDDD;
27+
border-bottom-color: #DDDDDD;
2828
}
2929
.in-band {
30-
background-color: white;
30+
background-color: white;
3131
}
3232

3333
.docblock code, .docblock-short code {
34-
background-color: #F5F5F5;
34+
background-color: #F5F5F5;
3535
}
3636
pre {
37-
background-color: #F5F5F5;
37+
background-color: #F5F5F5;
38+
}
39+
40+
.sidebar {
41+
background-color: #F1F1F1;
42+
}
43+
44+
.sidebar .current {
45+
background-color: #fff;
3846
}
3947

4048
.sidebar {
@@ -46,24 +54,24 @@ pre {
4654
}
4755

4856
.sidebar .location {
49-
border-color: #000;
50-
background-color: #fff;
51-
color: #333;
57+
border-color: #000;
58+
background-color: #fff;
59+
color: #333;
5260
}
5361

5462
.block a:hover {
55-
background: #F5F5F5;
63+
background: #F5F5F5;
5664
}
5765

5866
.line-numbers span { color: #c67e2d; }
5967
.line-numbers .line-highlighted {
60-
background-color: #f6fdb0 !important;
68+
background-color: #f6fdb0 !important;
6169
}
6270

6371
:target { background: #FDFFD3; }
6472
.content .highlighted {
65-
color: #000 !important;
66-
background-color: #ccc;
73+
color: #000 !important;
74+
background-color: #ccc;
6775
}
6876
.content .highlighted a, .content .highlighted span { color: #000 !important; }
6977
.content .highlighted.trait { background-color: #fece7e; }
@@ -76,21 +84,21 @@ pre {
7684
.content .highlighted.type { background-color: #c6afb3; }
7785

7886
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
79-
border-bottom-color: #DDD;
87+
border-bottom-color: #DDD;
8088
}
8189

8290
.docblock table {
83-
border-color: #ddd;
91+
border-color: #ddd;
8492
}
8593

8694
.docblock table td {
87-
border-top-color: #ddd;
88-
border-bottom-color: #ddd;
95+
border-top-color: #ddd;
96+
border-bottom-color: #ddd;
8997
}
9098

9199
.docblock table th {
92-
border-top-color: #ddd;
93-
border-bottom-color: #ddd;
100+
border-top-color: #ddd;
101+
border-bottom-color: #ddd;
94102
}
95103

96104
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #39a7bf; }
@@ -105,34 +113,78 @@ pre.rust .comment { color: #8E908C; }
105113
pre.rust .doccomment { color: #4D4D4C; }
106114

107115
nav {
108-
border-bottom-color: #e0e0e0;
116+
border-bottom-color: #e0e0e0;
109117
}
110118
nav.main .current {
111-
border-top-color: #000;
112-
border-bottom-color: #000;
119+
border-top-color: #000;
120+
border-bottom-color: #000;
113121
}
114122
nav.main .separator {
115-
border: 1px solid #000;
123+
border: 1px solid #000;
116124
}
117125
a {
118-
color: #000;
126+
color: #000;
119127
}
120128

121129
.docblock a, .docblock-short a, .stability a {
122-
color: #3873AD;
130+
color: #3873AD;
123131
}
124132

125133
a.test-arrow {
126-
color: #f5f5f5;
134+
color: #f5f5f5;
127135
}
128136

129137
.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
130138

131139
.search-input {
132-
color: #555;
133-
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
134-
background-color: white;
140+
color: #555;
141+
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
142+
background-color: white;
135143
}
136144

137145
.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
138146
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
147+
148+
#help > div {
149+
background: #e9e9e9;
150+
border-color: #bfbfbf;;
151+
}
152+
153+
#help dt {
154+
border-color: #bfbfbf;
155+
background: #fff;
156+
}
157+
158+
.since {
159+
color: grey;
160+
}
161+
162+
.line-numbers :target { background-color: transparent; }
163+
164+
/* Code highlighting */
165+
pre.rust .kw { color: #8959A8; }
166+
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
167+
pre.rust .number, pre.rust .string { color: #718C00; }
168+
pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
169+
pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
170+
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
171+
pre.rust .lifetime { color: #B76514; }
172+
pre.rust .question-mark {
173+
color: #ff9011;
174+
}
175+
176+
a.test-arrow {
177+
background-color: rgba(78, 139, 202, 0.2);
178+
}
179+
180+
a.test-arrow:hover{
181+
background-color: #4e8bca;
182+
}
183+
184+
.toggle-label {
185+
color: #999;
186+
}
187+
188+
:target > code {
189+
background: #FDFFD3;
190+
}

0 commit comments

Comments
 (0)