]> git.lizzy.rs Git - rust.git/commitdiff
Improve display of `<details>` in doc blocks
authorGuillaume Gomez <guillaume.gomez@huawei.com>
Sat, 21 May 2022 11:57:52 +0000 (13:57 +0200)
committerGuillaume Gomez <guillaume.gomez@huawei.com>
Mon, 30 May 2022 12:05:53 +0000 (14:05 +0200)
src/librustdoc/html/static/css/rustdoc.css

index d0229bdb5f23c5f153fd8d7d76e390138078b171..ed22a1a353e46ca1c2abd387396b351b303b4f45 100644 (file)
@@ -158,8 +158,8 @@ h1.fqn {
        Underlines elsewhere in the documentation break up visual flow and tend to invert
        section hierarchies. */
 h2,
        Underlines elsewhere in the documentation break up visual flow and tend to invert
        section hierarchies. */
 h2,
-.top-doc h3,
-.top-doc h4 {
+.top-doc .docblock > h3,
+.top-doc .docblock > h4 {
        border-bottom: 1px solid;
 }
 h3.code-header {
        border-bottom: 1px solid;
 }
 h3.code-header {
@@ -1669,6 +1669,18 @@ details.rustdoc-toggle[open] > summary.hideme::after {
        content: "Collapse";
 }
 
        content: "Collapse";
 }
 
+.docblock details summary {
+       display: flex;
+       list-style: none;
+       align-items: center;
+}
+.docblock details[open] summary::before {
+       content: "► ";
+}
+.docblock details[open] summary::before {
+       content: "▼ ";
+}
+
 /* Media Queries */
 
 @media (min-width: 701px) {
 /* Media Queries */
 
 @media (min-width: 701px) {