From f8b2e13d16e1c327f5f61b79d470afbecac9852a Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 25 Nov 2022 09:16:27 -0700 Subject: [PATCH 1/2] rustdoc: remove `cursor: pointer` from unclickable tooltip It's misleading unless it gets changed to respond to being clicked. --- src/librustdoc/html/static/css/rustdoc.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index c1f7a833834..063082c1c7c 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1139,7 +1139,6 @@ pre.rust .doccomment { .example-wrap .tooltip { position: absolute; display: block; - cursor: pointer; left: -25px; top: 5px; } From 75e4de61d4fe9897046f610b7499e8f6244bf609 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 25 Nov 2022 09:17:58 -0700 Subject: [PATCH 2/2] rustdoc: revert tooltip background color on light theme to readable text #fff on background #fdffd3 fails the [WCAG color contrast checker], and seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2. [WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/ --- src/librustdoc/html/static/css/themes/light.css | 2 +- src/test/rustdoc-gui/codeblock-tooltip.goml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index ff6c6863533..78a0cdcc3bc 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -64,7 +64,7 @@ --test-arrow-hover-background-color: #4e8bca; --target-background-color: #fdffd3; --target-border-color: #ad7c37; - --tooltip-background-color: #fdffd3; + --tooltip-background-color: #000; --tooltip-color: #fff; --kbd-color: #000; --kbd-background: #fafbfc; diff --git a/src/test/rustdoc-gui/codeblock-tooltip.goml b/src/test/rustdoc-gui/codeblock-tooltip.goml index caa1ab8f31e..4d923be3e78 100644 --- a/src/test/rustdoc-gui/codeblock-tooltip.goml +++ b/src/test/rustdoc-gui/codeblock-tooltip.goml @@ -146,7 +146,7 @@ call-function: ("check-colors", { }) call-function: ("check-colors", { "theme": "light", - "background": "rgb(253, 255, 211)", + "background": "rgb(0, 0, 0)", "color": "rgb(255, 255, 255)", "border": "rgb(224, 224, 224)", })