Fix mobile horizontal overflow on the Language section

The .mobile-commands-layout was rendering at ~2400px wide on mobile,
blowing out the entire .language-section to 2457px and causing the
section-lead text, the periodic table area, and everything else to
overflow the viewport horizontally.

Root cause: grid and flex items default to min-width: auto, which
lets them expand to fit any intrinsically wide descendant. The mobile
commands layout contains a .split-container (the demo split-compare
component) whose intrinsic content is ~2400px wide. That width
propagated up the parent chain — through .mobile-commands-layout
→ .commands-gallery → .commands-subsection → .language-content grid
track — and stretched the entire section.

Fix: cascade min-width: 0 through every descendant of the section so
the constraint stops the propagation at every layer.

  .language-section,
  .language-section * {
    min-width: 0;
  }

Verified at 390×844 (mobile): bodyScroll matches viewport, zero
overflowing elements, the line-length detector finding on
.mobile-cmd-desc is gone. Verified at 1280×800 (desktop): periodic
table and magazine layout still render at full content width with
no regression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-04-07 01:21:06 -07:00
co-authored by Claude Opus 4.6
parent 0d59981499
commit b54c46cac7
2 changed files with 45 additions and 10 deletions
+17 -5
View File
@@ -3598,6 +3598,9 @@ code {
display: grid;
gap: var(--spacing-lg);
}
.language-section, .language-section * {
min-width: 0;
}
.language-content .section-lead {
margin-bottom: 0;
}
@@ -3924,6 +3927,12 @@ code {
display: flex;
flex-direction: column;
gap: var(--spacing-md);
min-width: 0;
width: 100%;
}
.mobile-commands-layout > * {
min-width: 0;
max-width: 100%;
}
.commands-container {
display: none;
@@ -4738,17 +4747,20 @@ code {
}
.detection-cmd {
flex-shrink: 0;
font-family: var(--font-mono);
font-family: var(--font-body);
font-size: 0.8125rem;
color: var(--color-charcoal);
font-weight: 600;
color: var(--color-ink);
background: oklch(96% 0.005 350);
padding: 6px 14px;
border-radius: 6px;
white-space: nowrap;
text-decoration: none;
transition: background 0.15s ease, color 0.15s ease;
}
.detection-cmd::before {
content: '\279C ';
color: var(--color-accent);
a.detection-cmd:hover {
background: var(--color-accent);
color: white;
}
.antidote-footer {
text-align: center;