Skip to content

Commit f76c4b8

Browse files
Migrate summary toggle filter to CSS variable
1 parent dd12cd6 commit f76c4b8

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,7 @@ details.rustdoc-toggle > summary::before {
15211521
display: inline-block;
15221522
vertical-align: middle;
15231523
opacity: .5;
1524+
filter: var(--toggle-filter);
15241525
}
15251526

15261527
details.rustdoc-toggle > summary.hideme > span,

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Original by Dempfi (https://github.com/dempfi/ayu)
2121
--right-side-color: grey;
2222
--code-attribute-color: #999;
2323
--toggles-color: #999;
24+
--toggle-filter: invert(100%);
2425
--search-input-focused-border-color: #5c6773; /* Same as `--border-color`. */
2526
--copy-path-button-color: #fff;
2627
--copy-path-img-filter: invert(70%);
@@ -158,10 +159,6 @@ body.source .example-wrap pre.rust a {
158159
background: #333;
159160
}
160161

161-
details.rustdoc-toggle > summary::before {
162-
filter: invert(100%);
163-
}
164-
165162
.module-item .stab,
166163
.import-item .stab {
167164
color: #000;

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
--right-side-color: grey;
1717
--code-attribute-color: #999;
1818
--toggles-color: #999;
19+
--toggle-filter: invert(100%);
1920
--search-input-focused-border-color: #008dfd;
2021
--copy-path-button-color: #999;
2122
--copy-path-img-filter: invert(50%);
@@ -89,10 +90,6 @@ body.source .example-wrap pre.rust a {
8990
background: #333;
9091
}
9192

92-
details.rustdoc-toggle > summary::before {
93-
filter: invert(100%);
94-
}
95-
9693
#titles > button:not(.selected) {
9794
background-color: #252525;
9895
border-top-color: #252525;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
--right-side-color: grey;
1717
--code-attribute-color: #999;
1818
--toggles-color: #999;
19+
--toggle-filter: none;
1920
--search-input-focused-border-color: #66afe9;
2021
--copy-path-button-color: #999;
2122
--copy-path-img-filter: invert(50%);

0 commit comments

Comments
 (0)