Skip to content

Commit 63f82db

Browse files
Inline CSS background images directly into the CSS
1 parent 7c4a9a9 commit 63f82db

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

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

+13-4
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
806806
background-repeat: no-repeat;
807807
background-size: 20px;
808808
background-position: calc(100% - 2px) 56%;
809-
/* image is black color */
810-
background-image: url("down-arrow-927217e04c7463ac.svg");
809+
/* down arrow (image is black color) */
810+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
811+
width="128" height="128" viewBox="-30 -20 176 176"><path d="M111,40.5L64,87.499L17,40.5" \
812+
fill="none" stroke="black" strike-linecap="square" stroke-miterlimit="10" stroke-width="12"/> \
813+
</svg>');
811814
/* changes the arrow image color */
812815
filter: var(--crate-search-div-filter);
813816
}
@@ -1440,7 +1443,10 @@ details.toggle > summary.hideme > span {
14401443
}
14411444

14421445
details.toggle > summary::before {
1443-
background: url("toggle-plus-1092eb4930d581b0.svg") no-repeat top left;
1446+
/* toggle plus */
1447+
background: url('data:image/svg+xml,<svg width="17" height="17" \
1448+
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
1449+
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg>') no-repeat top left;
14441450
content: "";
14451451
cursor: pointer;
14461452
width: 16px;
@@ -1518,7 +1524,10 @@ details.toggle[open] > summary.hideme > span {
15181524
}
15191525

15201526
details.toggle[open] > summary::before {
1521-
background: url("toggle-minus-31bbd6e4c77f5c96.svg") no-repeat top left;
1527+
/* toggle minus */
1528+
background: url('data:image/svg+xml,<svg width="17" height="17" \
1529+
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
1530+
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7"/></svg>') no-repeat top left;
15221531
}
15231532

15241533
details.toggle[open] > summary::after {

src/librustdoc/html/static/images/down-arrow.svg

-1
This file was deleted.

src/librustdoc/html/static/images/toggle-minus.svg

-1
This file was deleted.

src/librustdoc/html/static/images/toggle-plus.svg

-1
This file was deleted.

src/librustdoc/html/static_files.rs

-3
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ static_files! {
102102
scrape_examples_js => "static/js/scrape-examples.js",
103103
wheel_svg => "static/images/wheel.svg",
104104
clipboard_svg => "static/images/clipboard.svg",
105-
down_arrow_svg => "static/images/down-arrow.svg",
106-
toggle_minus_png => "static/images/toggle-minus.svg",
107-
toggle_plus_png => "static/images/toggle-plus.svg",
108105
copyright => "static/COPYRIGHT.txt",
109106
license_apache => "static/LICENSE-APACHE.txt",
110107
license_mit => "static/LICENSE-MIT.txt",

0 commit comments

Comments
 (0)