Skip to content

rustdoc: change the +/- icons #107658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,28 @@ button {

button#toggle-all-docs {
padding: 0;
background: none;
margin-bottom: 2px;
border: none;
outline: none;
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
-webkit-appearance: none;
opacity: 0.5;
cursor: pointer;
width: 17px;
height: 17px;
vertical-align: middle;

background: url('data:image/svg+xml,<svg width="17" height="17" viewBox="0 0 17 17" fill="none" \
xmlns="http://www.w3.org/2000/svg"><path d="M4.32143 7L8.5 11.5L12.6786 7H15L8.5 14L2 7H4.32143Z" \
fill="gray"/><path d="M8.5 10L2 3L15 3L8.5 10Z" fill="gray"/></svg>') no-repeat top left;
}
button#toggle-all-docs:hover,
button#toggle-all-docs:focus {
opacity: 1;
}
button#toggle-all-docs.will-expand {
transform: rotate(180deg);
}

.rustdoc {
display: flex;
Expand Down Expand Up @@ -1451,9 +1467,9 @@ details.toggle > summary.hideme > span {

details.toggle > summary::before {
/* toggle plus */
background: url('data:image/svg+xml,<svg width="17" height="17" \
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg>') no-repeat top left;
background: url('data:image/svg+xml,<svg width="17" height="17" fill="gray" \
xmlns="http://www.w3.org/2000/svg"><path d="M13.75 9.5L5.25 14.5L5.25 4.5L13.75 9.5Z"/> \
</svg>') no-repeat top left;
content: "";
cursor: pointer;
width: 16px;
Expand Down Expand Up @@ -1509,7 +1525,7 @@ details.toggle > summary.hideme::before {
details.toggle > summary:not(.hideme)::before {
position: absolute;
left: -24px;
top: 4px;
top: 3px;
}

.impl-items > details.toggle > summary:not(.hideme)::before {
Expand All @@ -1532,15 +1548,20 @@ details.toggle[open] > summary.hideme > span {

details.toggle[open] > summary::before {
/* toggle minus */
background: url('data:image/svg+xml,<svg width="17" height="17" \
shape-rendering="crispEdges" stroke="black" fill="none" xmlns="http://www.w3.org/2000/svg"><path \
d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7"/></svg>') no-repeat top left;
background: url('data:image/svg+xml,<svg width="17" height="17" fill="gray" \
xmlns="http://www.w3.org/2000/svg"><path d="M9.5 13.75L4.5 5.25L14.5 5.25L9.5 13.75Z"/> \
</svg>') no-repeat top left;
}

details.toggle[open] > summary::after {
content: "Collapse";
}

details.toggle.type-contents-toggle > summary::before,
details.toggle.top-doc > summary::before {
margin-bottom: 5px;
}

/* This is needed in docblocks to have the "▶" element to be on the same line. */
.docblock summary > * {
display: inline-block;
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/html/templates/print_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ <h1> {#- -#}
{%- else -%}
{%- endmatch -%}
<button id="toggle-all-docs" title="collapse all docs"> {#- -#}
[<span>&#x2212;</span>] {#- -#}
</button> {#- -#}
</span> {#- -#}
</div> {#- -#}