docs: CSS: make cross-reference links more evident
authorJonathan Corbet <corbet@lwn.net>
Wed, 4 Jun 2025 14:18:40 +0000 (08:18 -0600)
committerJonathan Corbet <corbet@lwn.net>
Mon, 9 Jun 2025 20:43:39 +0000 (14:43 -0600)
The Sphinx Alabaster theme uses border-bottom to mark reference links; the
result does not render correctly (the underline is missing) in some browser
configurations.  Switch to using the standard text-underline property, and
use text-underline-offset to place that underline below any underscores in
the underlined text.

Suggested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/sphinx-static/custom.css

index f4285417c71aa9365d1110b5790fec8da6e149fc..06cedbae095c2cd0ede2448d7d729cd0ccf5f719 100644 (file)
@@ -136,3 +136,18 @@ div.language-selection:hover ul {
 div.language-selection ul li:hover {
     background: #dddddd;
 }
+
+/* Make xrefs more universally visible */
+a.reference, a.reference:hover {
+    border-bottom: none;
+    text-decoration: underline;
+    text-underline-offset: 0.3em;
+}
+
+/* Slightly different style for sidebar links */
+div.sphinxsidebar a { border-bottom: none; }
+div.sphinxsidebar a:hover {
+    border-bottom: none;
+    text-decoration: underline;
+    text-underline-offset: 0.3em;
+}