Skip to content

Commit 18fa47c

Browse files
authored
Rollup merge of rust-lang#92764 - GuillaumeGomez:fix-rust-logo-style, r=jsha
Fix rust logo style The style on the rust logo is currently broken: ![Screenshot from 2022-01-11 13-36-30](https://user-images.githubusercontent.com/3050060/148946754-a1a57253-bed0-44cf-a41c-83e0eecbd6b5.png) With this fix, we're back to normal: ![Screenshot from 2022-01-11 13-42-07](https://user-images.githubusercontent.com/3050060/148946778-99f44678-aac1-419f-bb8c-ffa837e0c1ee.png) I also used a GUI test to prevent future silent regressions. r? `@jsha`
2 parents d0440de + 24c6e96 commit 18fa47c

File tree

4 files changed

+81
-3
lines changed

4 files changed

+81
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pre, .rustdoc.source .example-wrap {
6161
background-color: #14191f;
6262
}
6363

64-
.rust-logo > img {
64+
.rust-logo {
6565
filter: drop-shadow(1px 0 0px #fff)
6666
drop-shadow(0 1px 0 #fff)
6767
drop-shadow(-1px 0 0 #fff)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pre, .rustdoc.source .example-wrap {
3232
background-color: #505050;
3333
}
3434

35-
.rust-logo > img {
35+
.rust-logo {
3636
filter: drop-shadow(1px 0 0px #fff)
3737
drop-shadow(0 1px 0 #fff)
3838
drop-shadow(-1px 0 0 #fff)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pre, .rustdoc.source .example-wrap {
4343
scrollbar-color: rgba(36, 37, 39, 0.6) #d9d9d9;
4444
}
4545

46-
.rust-logo > img {
46+
.rust-logo {
4747
/* No need for a border in here! */
4848
}
4949

src/test/rustdoc-gui/rust-logo.goml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// This test ensures that the correct style is applied to the rust logo in the sidebar.
2+
goto: file://|DOC_PATH|/test_docs/index.html
3+
4+
// First we start with the dark theme.
5+
local-storage: {
6+
"rustdoc-theme": "dark",
7+
"rustdoc-preferred-dark-theme": "dark",
8+
"rustdoc-use-system-theme": "false",
9+
}
10+
reload:
11+
12+
assert-css: (
13+
".rust-logo",
14+
{"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
15+
)
16+
17+
// In the source view page now.
18+
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
19+
20+
local-storage: {
21+
"rustdoc-theme": "dark",
22+
"rustdoc-preferred-dark-theme": "dark",
23+
"rustdoc-use-system-theme": "false",
24+
}
25+
reload:
26+
27+
assert-css: (
28+
".rust-logo",
29+
{"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
30+
)
31+
32+
// Then with the ayu theme.
33+
local-storage: {
34+
"rustdoc-theme": "ayu",
35+
"rustdoc-preferred-dark-theme": "ayu",
36+
"rustdoc-use-system-theme": "false",
37+
}
38+
reload:
39+
40+
assert-css: (
41+
".rust-logo",
42+
{"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
43+
)
44+
45+
// In the source view page now.
46+
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
47+
48+
local-storage: {
49+
"rustdoc-theme": "ayu",
50+
"rustdoc-preferred-dark-theme": "ayu",
51+
"rustdoc-use-system-theme": "false",
52+
}
53+
reload:
54+
55+
assert-css: (
56+
".rust-logo",
57+
{"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
58+
)
59+
60+
// And finally with the light theme.
61+
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
62+
reload:
63+
64+
assert-css: (
65+
".rust-logo",
66+
{"filter": "none"},
67+
)
68+
69+
// In the source view page now.
70+
goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
71+
72+
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
73+
reload:
74+
75+
assert-css: (
76+
".rust-logo",
77+
{"filter": "none"},
78+
)

0 commit comments

Comments
 (0)