Skip to content

Commit 8bbb54a

Browse files
authored
Rollup merge of #93896 - jsha:dark-colors, r=GuillaumeGomez
rustdoc: make item-infos dimmer on dark theme Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention. Demo: https://rustdoc.crud.net/jsha/dark-colors/std/os/linux/process/struct.PidFd.html https://rustdoc.crud.net/jsha/dark-colors/std/error/trait.Error.html#method.description Before: <img width=300 src="https://user-images.githubusercontent.com/220205/153565049-f35ee83e-181d-491c-b2af-7cce1baa4912.png"> After: <img width=300 src="https://user-images.githubusercontent.com/220205/181166727-b4218e96-daf1-46cd-a2df-5fd870eaa857.png"> r? `@GuillaumeGomez`
2 parents 20ffea6 + 20cc5f9 commit 8bbb54a

File tree

4 files changed

+12
-27
lines changed

4 files changed

+12
-27
lines changed

src/librustdoc/html/static/css/themes/ayu.css

+1-12
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,9 @@ details.rustdoc-toggle > summary::before {
203203
color: #000;
204204
}
205205

206-
/* Created this empty rule to satisfy the theme checks. */
207-
.stab.empty-impl {}
208-
.stab.must_implement {}
209-
210-
.stab.unstable,
211-
.stab.deprecated,
212-
.stab.portability,
213-
.stab.empty-impl,
214-
.stab.must_implement {
206+
.stab {
215207
color: #c5c5c5;
216208
background: #314559 !important;
217-
border-style: none !important;
218-
border-radius: 4px;
219-
padding: 3px 6px 3px 6px;
220209
}
221210

222211
.stab.portability > code {

src/librustdoc/html/static/css/themes/dark.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,12 @@ details.rustdoc-toggle > summary::before {
173173
border-color: #008dfd;
174174
}
175175

176-
.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; }
177-
.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #2f2f2f; }
178-
.stab.deprecated { background: #ffc4c4; border-color: #db7b7b; color: #2f2f2f; }
179-
.stab.must_implement { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; }
180-
.stab.portability { background: #F3DFFF; border-color: #b07bdb; color: #2f2f2f; }
181-
.stab.portability > code { background: none; }
176+
.stab { background: #314559; }
177+
178+
.stab.portability > code {
179+
color: #e6e1cf;
180+
background: none;
181+
}
182182

183183
.rightside,
184184
.out-of-band {

src/librustdoc/html/static/css/themes/light.css

+1-5
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,7 @@ details.rustdoc-toggle > summary::before {
160160
border-color: #66afe9;
161161
}
162162

163-
.stab.empty-impl { background: #FFF5D6; border-color: #FFC600; }
164-
.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
165-
.stab.deprecated { background: #ffc4c4; border-color: #db7b7b; }
166-
.stab.must_implement { background: #F3DFFF; border-color: #b07bdb; }
167-
.stab.portability { background: #F3DFFF; border-color: #b07bdb; }
163+
.stab { background: #FFF5D6; border-color: #FFC600; }
168164
.stab.portability > code { background: none; }
169165

170166
.rightside,

src/test/rustdoc-gui/label-next-to-symbol.goml

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ size: (1080, 600)
77
assert: (".stab.deprecated")
88
assert: (".stab.portability")
99

10-
// make sure that deprecated and portability are different colours
10+
// make sure that deprecated and portability have the right colors
1111
assert-css: (
1212
".item-table .item-left .stab.deprecated",
13-
{ "background-color": "rgb(255, 196, 196)" },
13+
{ "background-color": "rgb(255, 245, 214)" },
1414
)
1515
assert-css: (
1616
".item-table .item-left .stab.portability",
17-
{ "background-color": "rgb(243, 223, 255)" },
17+
{ "background-color": "rgb(255, 245, 214)" },
1818
)
1919

2020
// table like view
@@ -51,7 +51,7 @@ assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
5151
compare-elements-position-near: (
5252
"//*[@class='item-left module-item']//a[text()='replaced_function']",
5353
".item-left .stab.deprecated",
54-
{"y": 1},
54+
{"y": 2},
5555
)
5656
compare-elements-position: (
5757
".item-left .stab.deprecated",

0 commit comments

Comments
 (0)