From edc9901e7e344839b80097b7eed49ec9a6c3fa70 Mon Sep 17 00:00:00 2001 From: rbalsleyMSFT <53497092+rbalsleyMSFT@users.noreply.github.com> Date: Thu, 5 Feb 2026 12:59:27 -0800 Subject: [PATCH] Improves TOC layouts for long content Keeps heading permalink icons visible by allowing horizontal overflow. Prevents long code blocks and tables from overlapping the page TOC by enabling horizontal scrolling where needed. --- docs/_includes/head_custom.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/_includes/head_custom.html b/docs/_includes/head_custom.html index 743c529..83ffddb 100644 --- a/docs/_includes/head_custom.html +++ b/docs/_includes/head_custom.html @@ -75,7 +75,7 @@ word-break: break-word; } - .main-content :not(pre) > code { + .main-content :not(pre)>code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; @@ -132,8 +132,16 @@ margin-right: 0; justify-self: stretch; - /* Safety net: if anything still overflows, don't let it render under the TOC */ - overflow-x: hidden; + /* Keep heading permalink icons visible */ + /* (Just-the-Docs positions .anchor-heading to the left at desktop widths) */ + overflow-x: visible; + } + + /* Safety net: prevent long code/tables from overlapping the TOC */ + .main-content-wrap.has-page-toc .main-content pre, + .main-content-wrap.has-page-toc .main-content .highlighter-rouge, + .main-content-wrap.has-page-toc .main-content .table-wrapper { + overflow-x: auto; } /* TOC always stays in the right column */