Skip to content

Commit c3eb202

Browse files
Migrate scraped examples higlight CSS to variables
1 parent ac8952e commit c3eb202

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

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

+7
Original file line numberDiff line numberDiff line change
@@ -1959,6 +1959,13 @@ in storage.js
19591959
overflow-x: hidden;
19601960
}
19611961

1962+
.scraped-example .example-wrap .rust span.highlight {
1963+
background: var(--scrape-example-code-line-highlight);
1964+
}
1965+
.scraped-example .example-wrap .rust span.highlight.focus {
1966+
background: var(--scrape-example-code-line-highlight-focus);
1967+
}
1968+
19621969
.more-examples-toggle {
19631970
max-width: calc(100% + 25px);
19641971
margin-top: 10px;

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ Original by Dempfi (https://github.com/dempfi/ayu)
9191
--codeblock-link-background: #333;
9292
--scrape-example-toggle-line-background: #999;
9393
--scrape-example-toggle-line-hover-background: #c5c5c5;
94+
--scrape-example-code-line-highlight: rgb(91, 59, 1);
95+
--scrape-example-code-line-highlight-focus: rgb(124, 75, 15);
9496
}
9597

9698
h1, h2, h3, h4 {
@@ -206,12 +208,6 @@ above the `@media (max-width: 700px)` rules due to a bug in the css checker */
206208
border-color: white;
207209
color: white;
208210
}
209-
.scraped-example .example-wrap .rust span.highlight {
210-
background: rgb(91, 59, 1);
211-
}
212-
.scraped-example .example-wrap .rust span.highlight.focus {
213-
background: rgb(124, 75, 15);
214-
}
215211
.scraped-example:not(.expanded) .code-wrapper::before {
216212
background: linear-gradient(to bottom, rgba(15, 20, 25, 1), rgba(15, 20, 25, 0));
217213
}

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
--codeblock-link-background: #333;
8787
--scrape-example-toggle-line-background: #999;
8888
--scrape-example-toggle-line-hover-background: #c5c5c5;
89+
--scrape-example-code-line-highlight: rgb(91, 59, 1);
90+
--scrape-example-code-line-highlight-focus: rgb(124, 75, 15);
8991
}
9092

9193
#search-tabs > button:not(.selected) {
@@ -106,12 +108,6 @@
106108
border-color: white;
107109
color: white;
108110
}
109-
.scraped-example .example-wrap .rust span.highlight {
110-
background: rgb(91, 59, 1);
111-
}
112-
.scraped-example .example-wrap .rust span.highlight.focus {
113-
background: rgb(124, 75, 15);
114-
}
115111
.scraped-example:not(.expanded) .code-wrapper::before {
116112
background: linear-gradient(to bottom, rgba(53, 53, 53, 1), rgba(53, 53, 53, 0));
117113
}

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
--codeblock-link-background: #eee;
8484
--scrape-example-toggle-line-background: #ccc;
8585
--scrape-example-toggle-line-hover-background: #999;
86+
--scrape-example-code-line-highlight: #fcffd6;
87+
--scrape-example-code-line-highlight-focus: #f6fdb0;
8688
}
8789

8890
#search-tabs > button:not(.selected) {
@@ -103,12 +105,6 @@
103105
border-color: black;
104106
color: black;
105107
}
106-
.scraped-example .example-wrap .rust span.highlight {
107-
background: #fcffd6;
108-
}
109-
.scraped-example .example-wrap .rust span.highlight.focus {
110-
background: #f6fdb0;
111-
}
112108
.scraped-example:not(.expanded) .code-wrapper::before {
113109
background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
114110
}

0 commit comments

Comments
 (0)