From 6e956ef471831251c013ea8a6d6ab14a90d16ab7 Mon Sep 17 00:00:00 2001 From: Ryan Gibson Date: Mon, 18 Dec 2023 15:14:41 -0500 Subject: [PATCH 1/2] Add CSS overflow/wrapping on KaTeX, tables, and code sections --- assets/css/main.css | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/assets/css/main.css b/assets/css/main.css index 95c9030e2..8c1028978 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -111,6 +111,21 @@ body:has(#menu-controller:checked) { @apply absolute opacity-5 -z-10; } +/* Fix long KaTeX equations on mobile (see https://katex.org/docs/issues.html#css-customization) */ +.katex-display { overflow: auto hidden } + +/* Fix long tables breaking out of article on mobile */ +table { + display: block; + overflow: auto; +} + +/* Fix long inline code sections breaking out of article on mobile */ +code { + word-wrap: break-word; /* All browsers since IE 5.5+ */ + overflow-wrap: break-word; /* Renamed property in CSS3 draft spec */ +} + /* -- Chroma Highlight -- */ /* Background */ .prose .chroma { From 7b2f77526755be823e2b53d45d6c2300ce748bdb Mon Sep 17 00:00:00 2001 From: Ryan Gibson Date: Mon, 18 Dec 2023 15:15:59 -0500 Subject: [PATCH 2/2] Recompile CSS --- assets/css/compiled/main.css | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 34e5fef48..661a53003 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -4586,6 +4586,28 @@ body:has(#menu-controller:checked) { opacity: 0.05; } +/* Fix long KaTeX equations on mobile (see https://katex.org/docs/issues.html#css-customization) */ + +.katex-display { + overflow: auto hidden +} + +/* Fix long tables breaking out of article on mobile */ + +table { + display: block; + overflow: auto; +} + +/* Fix long inline code sections breaking out of article on mobile */ + +code { + word-wrap: break-word; + /* All browsers since IE 5.5+ */ + overflow-wrap: break-word; + /* Renamed property in CSS3 draft spec */ +} + /* -- Chroma Highlight -- */ /* Background */