Skip to content

[2.x] fix: complete the wide-screen breakpoints for the main layout - #4869

Merged
imorland merged 1 commit into
2.xfrom
im/complete-wide-breakpoints
Jul 31, 2026
Merged

[2.x] fix: complete the wide-screen breakpoints for the main layout#4869
imorland merged 1 commit into
2.xfrom
im/complete-wide-breakpoints

Conversation

@imorland

@imorland imorland commented Jul 31, 2026

Copy link
Copy Markdown
Member

Changes proposed in this pull request

The @desktop-xl (≥1600px), @desktop-xxl (≥2000px) and @desktop-xxxl (≥3000px) breakpoints were introduced in #4066 — but only the extension-discover grid ever used them. The main .container still stops stepping at @desktop-hd: every screen wider than 1100px renders the same fixed 1100px column, leaving 40–55% of the viewport as dead margin on ordinary 1440–2560px displays.

This completes what #4066 started:

  • .container steps through the existing bands: 1200px (hd), 1300px (xl), 1600px (xxl). Below 1100px nothing changes.
  • The desktop band widths are CSS custom properties (--container-hd / --container-xl / --container-xxl in root.less), so themes retune any band from :root without re-declaring media queries — media queries can't read custom properties, but their width values can.
  • Wider container ≠ longer text lines: from @desktop-xl up the discussion post stream is capped at --discussion-content-max-width (1000px), with the slack sitting between the prose and the scrubber sidebar. Without this, post text at a 1600px container reaches ~155 characters per line.

Measured (viewport → container / post text width): 1440 → 1200/830px · 1920 → 1300/895px · 2560 → 1600/895px (capped; previously 1100/730px fixed at every size).

Reviewers should focus on

  • The slack-absorption mechanics in DiscussionPage.less: the page container is row-reversed, so margin-right: auto on the content is the main-start auto margin that pushes prose flush-left with the whitespace before the scrubber.
  • Visual pass at wide viewports: index, discussion, tags grid verified at 1280/1440/1920/2560; the fixed-position composer aligns to the container and deserves a check with a wide window.
  • This is a visual change for every forum on screens ≥1100px, and custom LESS written against the fixed 1100px container exists in the wild — release-note-worthy either way.

Themer documentation: flarum/docs#567.

Confirmed

  • Frontend changes: LESS only — verified live at four viewport widths with before/after measurements.

The desktop-xl/xxl/xxxl breakpoints were introduced with the extension
list UI, but the main .container was never updated to use them: every
screen wider than 1100px rendered the same fixed width, leaving half
the viewport unused on modern displays.

The container now steps through the existing bands, and the desktop
band widths are CSS custom properties so themes can retune each band
from :root without re-declaring media queries.

Wider containers must not mean longer text lines: from desktop-xl up
the discussion post stream is capped (also a custom property), with the
slack sitting between the prose and the scrubber sidebar.
@imorland
imorland requested a review from a team as a code owner July 31, 2026 13:33
@imorland imorland added this to the 2.0.0-rc.6 milestone Jul 31, 2026
@imorland
imorland merged commit b3ec202 into 2.x Jul 31, 2026
32 of 90 checks passed
@imorland
imorland deleted the im/complete-wide-breakpoints branch July 31, 2026 13:55
imorland added a commit to flarum/docs that referenced this pull request Jul 31, 2026
Companion to flarum/framework#4869, which completes the wide-screen
breakpoint bands for the main layout and exposes the per-band container
widths (and the discussion prose cap) as CSS custom properties.
imorland added a commit that referenced this pull request Aug 5, 2026
The desktop band widths introduced in #4869 are not tied to the
breakpoints that open them: the hd band starts at 1100px but sets a
1200px width, so every viewport from 1100px to 1199px got a container up
to 100px wider than the screen.

That does not surface as a horizontal scrollbar. `body` hides the
overflow and `margin-left/right: auto` cannot resolve to a negative
value, so the container is pinned to the left and its right edge is
silently clipped -- the layout stops being centred and part of the
header runs off-screen.

Each band is now clamped with `min(..., 100%)`. The hd band goes fluid
between 1100px and 1199px and pins to 1200px from 1200px up, as
intended. The xl/xxl bands are not affected today, but they are clamped
too: the widths are custom properties so a theme can retune them from
:root and reintroduce the same mismatch.

`100%` rather than `100vw`, because `body` has `overflow-y: scroll` and
100vw would include the scrollbar gutter. It also behaves correctly when
the discussion list pane is pinned, where the containing block is
already narrowed by the pane width.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant