Some documentation pages contain long C API signatures that exceed
the content width and cause page-wide horizontal scroll overflow.
Override white-space on inner spans from nowrap to pre-wrap, which
preserves existing whitespace but allows line breaks at space
boundaries. overflow-wrap: anywhere is then applied to the signature
element so that long strings wider than the container can still
wrap where needed.
Examples:
https://docs.kernel.org/6.15/driver-api/regulator.html
https://docs.kernel.org/6.15/userspace-api/fwctl/fwctl-cxl.html
Signed-off-by: Rito Rhymes <rito@ritovision.com>
Assisted-by: Codex:GPT-5.4
Assisted-by: Claude:Opus-4.6
---
v4: switch to a whitespace-preserving wrapping approach instead of
contained horizontal scrolling
Documentation/sphinx-static/custom.css | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/sphinx-static/custom.css b/Documentation/sphinx-static/custom.css
index db24f4344..7226be803 100644
--- a/Documentation/sphinx-static/custom.css
+++ b/Documentation/sphinx-static/custom.css
@@ -40,6 +40,12 @@ li { text-indent: 0em; }
dl.function, dl.struct, dl.enum { margin-top: 2em; background-color: #ecf0f3; }
/* indent lines 2+ of multi-line function prototypes */
dl.function dt { margin-left: 10em; text-indent: -10em; }
+/*
+ * Wrap long C API signatures the way an overly long source line would
+ * wrap, keeping the entire signature visible without horizontal scroll.
+ */
+dl.c > dt { overflow-wrap: anywhere; }
+dl.c > dt span.pre { white-space: pre-wrap; }
dt.sig-object { font-size: larger; }
div.kernelindent { margin-left: 2em; margin-right: 4em; }
--
2.51.0