diff options
author | Earlopain <[email protected]> | 2024-09-30 13:32:39 +0200 |
---|---|---|
committer | git <[email protected]> | 2024-09-30 11:32:45 +0000 |
commit | 5ed67f48261ee0d50f12115908dfb9d3463e5fab (patch) | |
tree | c0750eddbe17922555acd76b417bfebd1f1abe5f /lib/rdoc/generator/template | |
parent | 81d26814be036a7b15c587d1e1832d9ddd24601e (diff) |
[ruby/rdoc] Only let browser search through source code until it's
expanded
(https://github.com/ruby/rdoc/pull/1181)
Something that's been bothering me is that while the source code is
not visible by default, the browser still jump to it when searching.
Adding the `visible` property prevents this.
Test it out yourself:
* `bundle exec rdoc`
* open `_site/index.html`
* Search for `NameError`
Before, you will get a match from `load_yaml` source code, after
you only get the match when that methods source code is expanded.
https://github.com/ruby/rdoc/commit/003126cc23
Diffstat (limited to 'lib/rdoc/generator/template')
-rw-r--r-- | lib/rdoc/generator/template/darkfish/css/rdoc.css | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rdoc/generator/template/darkfish/css/rdoc.css b/lib/rdoc/generator/template/darkfish/css/rdoc.css index 169a6331e9..7a42e62522 100644 --- a/lib/rdoc/generator/template/darkfish/css/rdoc.css +++ b/lib/rdoc/generator/template/darkfish/css/rdoc.css @@ -585,6 +585,9 @@ main header h3 { /* @group Method Details */ main .method-source-code { + /* While this is already invisible through the rule below, this will inform the browser to + not consider source code during text searching until it is actually expanded. */ + visibility: hidden; max-height: 0; overflow: auto; transition-duration: 200ms; @@ -594,6 +597,7 @@ main .method-source-code { } main .method-source-code.active-menu { + visibility: visible; max-height: 100vh; } |