Skip to content

Commit da80c3e

Browse files
committed
fix: complete the wide-screen breakpoints for the main layout
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.
1 parent b20fecc commit da80c3e

3 files changed

Lines changed: 33 additions & 1 deletion

File tree

framework/core/less/common/root.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,16 @@
175175

176176
:root {
177177

178+
// Main container width per breakpoint band. Themes can retune each band
179+
// (or pin them all to one value) without re-declaring media queries.
180+
--container-hd: 1200px;
181+
--container-xl: 1300px;
182+
--container-xxl: 1600px;
183+
184+
// Readability cap for the discussion post stream on wide screens: the
185+
// container keeps growing, prose does not. See DiscussionPage.less.
186+
--discussion-content-max-width: 1000px;
187+
178188
--primary-color: @primary-color;
179189
--secondary-color: @secondary-color;
180190

framework/core/less/common/scaffolding.less

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,19 @@ p {
6363
@media @desktop {
6464
width: @screen-desktop;
6565
}
66+
// The xl/xxl breakpoints exist since the extension list UI introduced them,
67+
// but the container never used them: every screen wider than 1100px got the
68+
// same fixed width, wasting half the viewport on modern displays. The widths
69+
// are CSS custom properties (see root.less) so themes can retune each band
70+
// without re-declaring the media queries.
6671
@media @desktop-hd {
67-
width: @screen-desktop-hd;
72+
width: var(--container-hd);
73+
}
74+
@media @desktop-xl {
75+
width: var(--container-xl);
76+
}
77+
@media @desktop-xxl {
78+
width: var(--container-xxl);
6879
}
6980
}
7081

framework/core/less/forum/DiscussionPage.less

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,14 @@
6969
}
7070
}
7171
}
72+
73+
// On the widest bands the container keeps growing but prose should not: long
74+
// text lines get hard to read. Cap the post stream and let the slack sit
75+
// between it and the scrubber sidebar (the container is row-reversed, so the
76+
// auto margin on the content's main-start side absorbs the slack).
77+
@media @desktop-xl {
78+
.DiscussionPage .Page-content {
79+
max-width: var(--discussion-content-max-width);
80+
margin-right: auto;
81+
}
82+
}

0 commit comments

Comments
 (0)