Skip to content

Commit 5494da2

Browse files
Migrate more scraped examples CSS rules to CSS variables
1 parent aa20f88 commit 5494da2

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,14 @@ in storage.js
19651965
.scraped-example .example-wrap .rust span.highlight.focus {
19661966
background: var(--scrape-example-code-line-highlight-focus);
19671967
}
1968+
.scraped-example-list .scrape-help {
1969+
border-color: var(--scrape-example-help-border-color);
1970+
color: var(--scrape-example-help-color);
1971+
}
1972+
.scraped-example-list .scrape-help:hover {
1973+
border-color: var(--scrape-example-help-hover-border-color);
1974+
color: var(--scrape-example-help-hover-color);
1975+
}
19681976

19691977
.more-examples-toggle {
19701978
max-width: calc(100% + 25px);

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ Original by Dempfi (https://github.com/dempfi/ayu)
9393
--scrape-example-toggle-line-hover-background: #c5c5c5;
9494
--scrape-example-code-line-highlight: rgb(91, 59, 1);
9595
--scrape-example-code-line-highlight-focus: rgb(124, 75, 15);
96+
--scrape-example-help-border-color: #aaa;
97+
--scrape-example-help-color: #eee;
98+
--scrape-example-help-hover-border-color: #fff;
99+
--scrape-example-help-hover-color: #fff;
96100
}
97101

98102
h1, h2, h3, h4 {
@@ -200,14 +204,6 @@ above the `@media (max-width: 700px)` rules due to a bug in the css checker */
200204
color: #ffb44c;
201205
}
202206

203-
.scraped-example-list .scrape-help {
204-
border-color: #aaa;
205-
color: #eee;
206-
}
207-
.scraped-example-list .scrape-help:hover {
208-
border-color: white;
209-
color: white;
210-
}
211207
.scraped-example:not(.expanded) .code-wrapper::before {
212208
background: linear-gradient(to bottom, rgba(15, 20, 25, 1), rgba(15, 20, 25, 0));
213209
}

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
--scrape-example-toggle-line-hover-background: #c5c5c5;
8989
--scrape-example-code-line-highlight: rgb(91, 59, 1);
9090
--scrape-example-code-line-highlight-focus: rgb(124, 75, 15);
91+
--scrape-example-help-border-color: #aaa;
92+
--scrape-example-help-color: #eee;
93+
--scrape-example-help-hover-border-color: #fff;
94+
--scrape-example-help-hover-color: #fff;
9195
}
9296

9397
#search-tabs > button:not(.selected) {
@@ -100,14 +104,6 @@
100104
background-color: #353535;
101105
}
102106

103-
.scraped-example-list .scrape-help {
104-
border-color: #aaa;
105-
color: #eee;
106-
}
107-
.scraped-example-list .scrape-help:hover {
108-
border-color: white;
109-
color: white;
110-
}
111107
.scraped-example:not(.expanded) .code-wrapper::before {
112108
background: linear-gradient(to bottom, rgba(53, 53, 53, 1), rgba(53, 53, 53, 0));
113109
}

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
--scrape-example-toggle-line-hover-background: #999;
8686
--scrape-example-code-line-highlight: #fcffd6;
8787
--scrape-example-code-line-highlight-focus: #f6fdb0;
88+
--scrape-example-help-border-color: #555;
89+
--scrape-example-help-color: #333;
90+
--scrape-example-help-hover-border-color: #000;
91+
--scrape-example-help-hover-color: #000;
8892
}
8993

9094
#search-tabs > button:not(.selected) {
@@ -97,14 +101,6 @@
97101
border-top-color: #0089ff;
98102
}
99103

100-
.scraped-example-list .scrape-help {
101-
border-color: #555;
102-
color: #333;
103-
}
104-
.scraped-example-list .scrape-help:hover {
105-
border-color: black;
106-
color: black;
107-
}
108104
.scraped-example:not(.expanded) .code-wrapper::before {
109105
background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
110106
}

0 commit comments

Comments
 (0)