diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 2a9548712f086..3f7030ef841e1 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -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; @@ -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; @@ -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 { @@ -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; diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index 3a1867b7feba3..6b9903f472eee 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -22,7 +22,6 @@ <h1> {#- -#} {%- else -%} {%- endmatch -%} <button id="toggle-all-docs" title="collapse all docs"> {#- -#} - [<span>−</span>] {#- -#} </button> {#- -#} </span> {#- -#} </div> {#- -#}