From ac732b62dd823a669628ca8a54655c18ea269c7d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 17 Sep 2022 09:38:57 -0700 Subject: [PATCH] rustdoc: clean up `#toggle-all-docs` This change converts the element from an `` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`. --- src/librustdoc/html/static/css/rustdoc.css | 12 ++++++++---- src/librustdoc/html/templates/print_item.html | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 293c9787609..f49176e7201 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -163,9 +163,6 @@ h1.fqn { padding-bottom: 6px; margin-bottom: 15px; } -#toggle-all-docs { - text-decoration: none; -} /* The only headings that get underlines are: Markdown-generated headings within the top-doc Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc) @@ -209,7 +206,7 @@ ul.all-items { font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif; } -a#toggle-all-docs, +#toggle-all-docs, a.anchor, .small-section-header a, #source-sidebar a, @@ -303,6 +300,13 @@ button { padding: 1px 6px; } +button#toggle-all-docs { + padding: 0; + background: none; + border: none; + cursor: pointer; +} + /* end tweaks for normalize.css 8 */ .rustdoc { diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index b6ce3ea3dee..e497b619366 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -21,8 +21,8 @@ source ยท {# -#} {%- else -%} {%- endmatch -%} - {#- -#} - [] {#- -#} - {#- -#} + {#- -#} {#- -#} {#- -#}