From 476e16a9998a5ac86cd358e89a9399ec1a039c7f Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Thu, 21 Mar 2024 23:35:09 -0400 Subject: [PATCH] Docs: Python API: Fixes for mobile browsers - Collapse field list on mobile browsers - Allow horizontal lists to collapse when they do not have enough space - Break long code reference links --- doc/python_api/static/css/theme_overrides.css | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/python_api/static/css/theme_overrides.css b/doc/python_api/static/css/theme_overrides.css index c92ea04aacc..10d08e7d27c 100644 --- a/doc/python_api/static/css/theme_overrides.css +++ b/doc/python_api/static/css/theme_overrides.css @@ -67,10 +67,16 @@ dl dt { dl.field-list { display: grid; grid-template-columns: auto minmax(80%, 95%); +} - p { - margin-bottom: 0; - } +dl.field-list > dd > p:last-child { + margin-bottom: 0; +} + +@media (max-width: calc(67em / 2)) { + dl.field-list { + grid-template-columns: unset; + } } /* TABLE & FIGURE */ @@ -94,6 +100,12 @@ figcaption { } } +/* Allow horizontal lists to collapse on narrow screens */ +.hlist tr { + display: flex; + flex-flow: row wrap; +} + /* End TABLE & FIGURE. */ /* Force admonition to span the full width if close to a figure */ @@ -141,6 +153,11 @@ a { text-decoration: none; } +/* Break long code references onto a second line */ +a > code.docutils { + overflow-wrap: anywhere; +} + /* Quotes for Fig. "link". */ a[href^="#fig-"]::before { content: "\201c";