diff options
| author | Michael Howell <michael@notriddle.com> | 2022-12-15 12:05:27 -0700 |
|---|---|---|
| committer | Michael Howell <michael@notriddle.com> | 2022-12-15 12:05:27 -0700 |
| commit | f28a8ca1dce6b8e8ce7d89bdb2030d74d06039c4 (patch) | |
| tree | f2b2bdf1579f3dcaf1a2bef365b07e58b83a441e /src/librustdoc/html/static/css | |
| parent | 984eab57f708e62c09b3d708033fe620130b5f39 (diff) | |
| download | rust-f28a8ca1dce6b8e8ce7d89bdb2030d74d06039c4.tar.gz rust-f28a8ca1dce6b8e8ce7d89bdb2030d74d06039c4.zip | |
rustdoc: simplify CSS for codeblock tooltips
Instead of making its parts `display: none` and then changing it on hover, just make the pseudo-element itself on hover.
Diffstat (limited to 'src/librustdoc/html/static/css')
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index bc1e15b3593..0cdb164146a 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1114,8 +1114,7 @@ pre.rust .doccomment { top: 5px; } -.example-wrap .tooltip::after { - display: none; +.example-wrap .tooltip:hover::after { text-align: center; padding: 5px 3px 3px 3px; border-radius: 6px; @@ -1130,35 +1129,30 @@ pre.rust .doccomment { color: var(--tooltip-color); } -.example-wrap .tooltip::before { +.example-wrap .tooltip:hover::before { content: " "; position: absolute; top: 50%; left: 16px; margin-top: -5px; - display: none; z-index: 1; border: 5px solid transparent; border-right-color: var(--tooltip-background-color); } -.example-wrap.ignore .tooltip::after { +.example-wrap.ignore .tooltip:hover::after { content: "This example is not tested"; } -.example-wrap.compile_fail .tooltip::after { +.example-wrap.compile_fail .tooltip:hover::after { content: "This example deliberately fails to compile"; } -.example-wrap.should_panic .tooltip::after { +.example-wrap.should_panic .tooltip:hover::after { content: "This example panics"; } -.example-wrap.edition .tooltip::after { +.example-wrap.edition .tooltip:hover::after { content: "This code runs with edition " attr(data-edition); } -.example-wrap .tooltip:hover::before, .example-wrap .tooltip:hover::after { - display: inline; -} - .example-wrap.compile_fail .tooltip, .example-wrap.should_panic .tooltip, .example-wrap.ignore .tooltip { |
