From be8350998ace8ff8cf05079d706833ef1f0bfbd1 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Sun, 8 Sep 2024 22:22:28 +0100 Subject: [PATCH] Use details tag for method toggling --- lib/rdoc/generator/template/darkfish/class.rhtml | 16 ++++++++++++---- .../generator/template/darkfish/css/rdoc.css | 10 +++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lib/rdoc/generator/template/darkfish/class.rhtml b/lib/rdoc/generator/template/darkfish/class.rhtml index d95c7d7182..171dba7472 100644 --- a/lib/rdoc/generator/template/darkfish/class.rhtml +++ b/lib/rdoc/generator/template/darkfish/class.rhtml @@ -109,7 +109,11 @@ gsub(/(.*)[-=]>/, '\1→') %> <%- if i == 0 and method.token_stream then -%> - Toggle source +
+
+ Source +
+
<%- end -%> <%- end -%> @@ -119,10 +123,14 @@ <%- else -%>
- <%= h method.name %><%= h method.param_seq %> + <%= h method.name %> + <%= h method.param_seq %> <%- if method.token_stream then -%> - Toggle source +
+
+ Source +
+
<%- end -%>
<%- end -%> diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css index 1cfbf533d5..bac9edd3f0 100644 --- a/lib/rdoc/generator/template/darkfish/css/rdoc.css +++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css @@ -626,7 +626,6 @@ main .method-click-advice { position: absolute; top: 2px; right: 0px; - font-size: 12px; padding-right: 20px; line-height: 20px; color: var(--secondary-color); @@ -735,6 +734,15 @@ main .attribute-access-type { overflow-x: auto; white-space: nowrap; } + + .method-controls { + position: static; + } + + main .method-click-advice { + position: static; + display: inline-block; + } } /* @end */