Skip to content

Commit a731775

Browse files
authored
Docs: mobile layout fix (#2466)
* Remove console warning * Fix table overflow issue on mobile
1 parent ff86a64 commit a731775

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

docs/extra.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ h1, h2, h3, h4, h5, h6 {
5959
left: -3.236em;
6060
max-width: calc(100cqw);
6161
width: fit-content;
62-
min-width: calc(100% + 3.236em + 3.236em);
62+
min-width: min(calc(100% + 3.236em + 3.236em), 100cqw);
6363
}
6464
.rst-content .section .wy-table-responsive .docutils {
6565
padding-left: 3.236em;

docs/theme_overrides/js/theme.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,13 @@ function ThemeNav () {
134134
// .wy-table-responsive activates css rules that change the size of
135135
// tables, making anchor points move around.
136136
console.log('Document ready, checking for anchor in URL');
137-
const anchorEl = document.querySelector(window.location.hash);
138-
anchorEl.getBoundingClientRect(); // Force layout to ensure scrollIntoView works correctly
139-
if (anchorEl) {
140-
console.log('Anchor element:', anchorEl);
141-
anchorEl.scrollIntoView({ behavior: 'instant', block: 'start' });
137+
if (window.location.hash) {
138+
const anchorEl = document.querySelector(window.location.hash);
139+
anchorEl.getBoundingClientRect(); // Force layout to ensure scrollIntoView works correctly
140+
if (anchorEl) {
141+
console.log('Anchor element:', anchorEl);
142+
anchorEl.scrollIntoView({ behavior: 'instant', block: 'start' });
143+
}
142144
}
143145
// end edit by joerick
144146
};

0 commit comments

Comments
 (0)