Skip to content

Commit ffb2869

Browse files
Migrate test-arrow to CSS variables
1 parent b0f3940 commit ffb2869

File tree

4 files changed

+18
-30
lines changed

4 files changed

+18
-30
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,12 @@ a.test-arrow {
12041204
top: 5px;
12051205
right: 5px;
12061206
z-index: 1;
1207+
color: var(--test-arrow-color);
1208+
background-color: var(--test-arrow-background-color);
1209+
}
1210+
a.test-arrow:hover {
1211+
color: var(--test-arrow-hover-color);
1212+
background-color: var(--test-arrow-hover-background-color);
12071213
}
12081214
.example-wrap:hover .test-arrow {
12091215
visibility: visible;

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ Original by Dempfi (https://github.com/dempfi/ayu)
5858
--example-line-numbers-border-color: none;
5959
--src-line-numbers-span-color: #5c6773;
6060
--src-line-number-highlighted-background-color: rgba(255, 236, 164, 0.06);
61+
--test-arrow-color: #788797;
62+
--test-arrow-background-color: rgba(57, 175, 215, 0.09);
63+
--test-arrow-hover-color: #c5c5c5;
64+
--test-arrow-hover-background-color: rgba(57, 175, 215, 0.368);
6165
}
6266

6367
.slider {
@@ -171,18 +175,6 @@ details.rustdoc-toggle > summary::before {
171175
color: #788797;
172176
}
173177

174-
a.test-arrow {
175-
font-size: 100%;
176-
color: #788797;
177-
border-radius: 4px;
178-
background-color: rgba(57, 175, 215, 0.09);
179-
}
180-
181-
a.test-arrow:hover {
182-
background-color: rgba(57, 175, 215, 0.368);
183-
color: #c5c5c5;
184-
}
185-
186178
:target {
187179
background: rgba(255, 236, 164, 0.06);
188180
border-right: 3px solid rgba(255, 180, 76, 0.85);

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
--example-line-numbers-border-color: #4a4949;
5454
--src-line-numbers-span-color: #3b91e2;
5555
--src-line-number-highlighted-background-color: #0a042f;
56+
--test-arrow-color: #dedede;
57+
--test-arrow-background-color: rgba(78, 139, 202, 0.2);
58+
--test-arrow-hover-color: #dedede;
59+
--test-arrow-hover-background-color: #4e8bca;
5660
}
5761

5862
.slider {
@@ -93,15 +97,6 @@ details.rustdoc-toggle > summary::before {
9397
filter: invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);
9498
}
9599

96-
a.test-arrow {
97-
color: #dedede;
98-
background-color: rgba(78, 139, 202, 0.2);
99-
}
100-
101-
a.test-arrow:hover{
102-
background-color: #4e8bca;
103-
}
104-
105100
:target {
106101
background-color: #494a3d;
107102
border-right: 3px solid #bb7410;

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
--example-line-numbers-border-color: #c7c7c7;
5454
--src-line-numbers-span-color: #c67e2d;
5555
--src-line-number-highlighted-background-color: #fdffd3;
56+
--test-arrow-color: #f5f5f5;
57+
--test-arrow-background-color: rgba(78, 139, 202, 0.2);
58+
--test-arrow-hover-color: #f5f5f5;
59+
--test-arrow-hover-background-color: #4e8bca;
5660
}
5761

5862
.slider {
@@ -88,15 +92,6 @@ body.source .example-wrap pre.rust a {
8892
filter: invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);
8993
}
9094

91-
a.test-arrow {
92-
color: #f5f5f5;
93-
background-color: rgba(78, 139, 202, 0.2);
94-
}
95-
96-
a.test-arrow:hover{
97-
background-color: #4e8bca;
98-
}
99-
10095
:target {
10196
background: #FDFFD3;
10297
border-right: 3px solid #AD7C37;

0 commit comments

Comments
 (0)