Skip to content

Commit 8ae479a

Browse files
Migrate Jump to def links background to CSS variable
1 parent 984eab5 commit 8ae479a

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/librustdoc/html/static/css/rustdoc.css

+4
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,10 @@ pre.rust .doccomment {
10711071
color: var(--code-highlight-doc-comment-color);
10721072
}
10731073

1074+
.rustdoc.source .example-wrap pre.rust a {
1075+
background: var(--codeblock-link-background);
1076+
}
1077+
10741078
.example-wrap.compile_fail,
10751079
.example-wrap.should_panic {
10761080
border-left: 2px solid var(--codeblock-error-color);

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
8888
--source-sidebar-background-selected: #14191f;
8989
--source-sidebar-background-hover: #14191f;
9090
--table-alt-row-background-color: #191f26;
91+
--codeblock-link-background: #333;
9192
}
9293

9394
h1, h2, h3, h4 {
@@ -154,9 +155,6 @@ pre, .rustdoc.source .example-wrap {
154155
.sidebar h3 a {
155156
color: white;
156157
}
157-
body.source .example-wrap pre.rust a {
158-
background: #333;
159-
}
160158

161159
.result-name .primitive > i, .result-name .keyword > i {
162160
color: #788797;

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@
8383
--source-sidebar-background-selected: #333;
8484
--source-sidebar-background-hover: #444;
8585
--table-alt-row-background-color: #2A2A2A;
86-
}
87-
88-
body.source .example-wrap pre.rust a {
89-
background: #333;
86+
--codeblock-link-background: #333;
9087
}
9188

9289
#titles > button:not(.selected) {

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

+1-4
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@
8080
--source-sidebar-background-selected: #fff;
8181
--source-sidebar-background-hover: #e0e0e0;
8282
--table-alt-row-background-color: #F5F5F5;
83-
}
84-
85-
body.source .example-wrap pre.rust a {
86-
background: #eee;
83+
--codeblock-link-background: #eee;
8784
}
8885

8986
#titles > button:not(.selected) {

0 commit comments

Comments
 (0)