From 39757d421eea080644af14c9d759c26634d86ed8 Mon Sep 17 00:00:00 2001 From: Amjad Ben Hedhili Date: Mon, 5 May 2025 07:17:36 +0100 Subject: [PATCH] Remove horizontal scrolling on mobile (#24927) (cherry picked from commit 8b82f5de3848f195305d297a03d0f6796e0ab121) --- doc/nimdoc.css | 11 ++++++++++- nimdoc/testproject/expected/nimdoc.out.css | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/nimdoc.css b/doc/nimdoc.css index d50f766ed4..2032019c01 100644 --- a/doc/nimdoc.css +++ b/doc/nimdoc.css @@ -120,11 +120,17 @@ Modified by Boyd Greenfield and narimiran } html { + overflow-x: hidden; + max-width: 100%; + box-sizing: border-box; font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { + overflow-x: hidden; + max-width: 100%; + box-sizing: border-box; font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; font-weight: 400; font-size: 1.125em; @@ -561,6 +567,8 @@ blockquote.markdown-quote { padding-left: 3px; padding-right: 3px; border-radius: 4px; + white-space: normal; + word-break: break-all; } span.tok { @@ -580,13 +588,14 @@ pre { display: inline-block; box-sizing: border-box; min-width: 100%; + max-width: 100%; padding: 0.5em; margin-top: 0.5em; margin-bottom: 0.5em; font-size: 0.85em; white-space: pre !important; overflow-y: hidden; - overflow-x: visible; + overflow-x: auto; background-color: var(--secondary-background); border: 1px solid var(--border); -webkit-border-radius: 6px; diff --git a/nimdoc/testproject/expected/nimdoc.out.css b/nimdoc/testproject/expected/nimdoc.out.css index d50f766ed4..2032019c01 100644 --- a/nimdoc/testproject/expected/nimdoc.out.css +++ b/nimdoc/testproject/expected/nimdoc.out.css @@ -120,11 +120,17 @@ Modified by Boyd Greenfield and narimiran } html { + overflow-x: hidden; + max-width: 100%; + box-sizing: border-box; font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } body { + overflow-x: hidden; + max-width: 100%; + box-sizing: border-box; font-family: "Lato", "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif; font-weight: 400; font-size: 1.125em; @@ -561,6 +567,8 @@ blockquote.markdown-quote { padding-left: 3px; padding-right: 3px; border-radius: 4px; + white-space: normal; + word-break: break-all; } span.tok { @@ -580,13 +588,14 @@ pre { display: inline-block; box-sizing: border-box; min-width: 100%; + max-width: 100%; padding: 0.5em; margin-top: 0.5em; margin-bottom: 0.5em; font-size: 0.85em; white-space: pre !important; overflow-y: hidden; - overflow-x: visible; + overflow-x: auto; background-color: var(--secondary-background); border: 1px solid var(--border); -webkit-border-radius: 6px;