Skip to content

Commit 75ea3a9

Browse files
authored
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle
Inline CSS background images directly into the CSS A nice advantage of this is that it removes a few entries in the list of static files. r? ``@notriddle``
2 parents 150b9d7 + 63f82db commit 75ea3a9

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
@@ -814,8 +814,11 @@ so that we can apply CSS-filters to change the arrow color in themes */
814814
background-repeat: no-repeat;
815815
background-size: 20px;
816816
background-position: calc(100% - 2px) 56%;
817-
/* image is black color */
818-
background-image: url("down-arrow-927217e04c7463ac.svg");
817+
/* down arrow (image is black color) */
818+
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" \
819+
width="128" height="128" viewBox="-30 -20 176 176"><path d="M111,40.5L64,87.499L17,40.5" \
820+
fill="none" stroke="black" strike-linecap="square" stroke-miterlimit="10" stroke-width="12"/> \
821+
</svg>');
819822
/* changes the arrow image color */
820823
filter: var(--crate-search-div-filter);
821824
}
@@ -1444,7 +1447,10 @@ details.toggle > summary.hideme > span {
14441447
}
14451448

14461449
details.toggle > summary::before {
1447-
background: url("toggle-plus-1092eb4930d581b0.svg") no-repeat top left;
1450+
/* toggle plus */
1451+
background: url('data:image/svg+xml,<svg width="17" height="17" \
1452+
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
1453+
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg>') no-repeat top left;
14481454
content: "";
14491455
cursor: pointer;
14501456
width: 16px;
@@ -1522,7 +1528,10 @@ details.toggle[open] > summary.hideme > span {
15221528
}
15231529

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

15281537
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)