Skip to content

Commit 75c6a91

Browse files
Rollup merge of rust-lang#88111 - GuillaumeGomez:background-color-jump-to-def, r=jhpratt
Add background-color on clickable definitions in source code Someone suggested to add a decoration on clickable elements in the source code pages: ![Screenshot from 2021-08-17 14-49-39](https://user-images.githubusercontent.com/3050060/129728911-def74f9e-50e2-40d2-b512-e23f1b3d0409.png) ![Screenshot from 2021-08-17 14-49-47](https://user-images.githubusercontent.com/3050060/129728925-14aec500-82ff-4336-955a-4173c769deeb.png) ![Screenshot from 2021-08-17 14-49-52](https://user-images.githubusercontent.com/3050060/129728927-a8a89d7a-e837-4ff5-b094-35be23629d14.png) The idea is to not disturb the reading while telling the reader "you can click on this one", which is why it's not a text decoration. What do you think `@rust-lang/rustdoc` ? r? `@Nemo157`
2 parents fbaa4a2 + 7ce7fe7 commit 75c6a91

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ nav.main .separator {
216216
a {
217217
color: #c5c5c5;
218218
}
219+
body.source .example-wrap pre.rust a {
220+
background: #c5c5c5;
221+
}
219222

220223
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
221224
.docblock-short a:not(.srclink):not(.test-arrow), .item-info a,

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

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ nav.main .separator {
177177
a {
178178
color: #ddd;
179179
}
180+
body.source .example-wrap pre.rust a {
181+
background: #333;
182+
}
180183

181184
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
182185
.docblock-short a:not(.srclink):not(.test-arrow), .item-info a,

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

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ nav.main .separator {
172172
a {
173173
color: #000;
174174
}
175+
body.source .example-wrap pre.rust a {
176+
background: #eee;
177+
}
175178

176179
.docblock:not(.type-decl) a:not(.srclink):not(.test-arrow),
177180
.docblock-short a:not(.srclink):not(.test-arrow), .item-info a,

0 commit comments

Comments
 (0)