Skip to content

[2.x] fix: align the drawer's dropdown labels with the other control labels - #5069

Merged
imorland merged 1 commit into
flarum:2.xfrom
karl-bullock:fix-drawer-label-alignment
Oct 4, 2026
Merged

imorland merged 1 commit into
flarum:2.xfrom
karl-bullock:fix-drawer-label-alignment

Conversation

@karl-bullock

Copy link
Copy Markdown
Member

Fixes #5068.

.Button already spaces an icon from its label with gap: 7px in less/common/Button.less. less/forum/HeaderDropdown.less also sets margin-left: 7px on the toggle's label, which predates that gap and now adds to it, so a .HeaderDropdown toggle sits 14px from its icon while every other control in the same list sits at 7px.

That stayed invisible while the drawer had nothing labelled to compare against. rc.8 made search a labelled button and scoped the icon-only collapse to @media @tablet-up, so the drawer now renders several labelled icon rows at once and the mismatch shows as a ragged left edge.

Verification

I removed the rule on a 2.0.0-rc.8 install, let the assets recompile, and measured where each label starts in the drawer at a 390px viewport, signed in as an admin:

Drawer row Before After
Search Forum 47.5px 47.5px
Flagged Posts 54.5px 47.5px
System preference 54.5px 47.5px
Notifications 54.5px 47.5px

Above @tablet-up nothing moves: those toggles collapse to .Button--icon(), which hides .Button-label outright. SessionDropdown keeps its label up there but never carried the HeaderDropdown class, so it is not affected either, which I confirmed both in the markup and by re-adding the rule at runtime and seeing its label stay put.

The Sign Up and Log In rows still begin at the icon column rather than the label column, since they carry no icon at all. That is long standing behaviour and I have left it alone.

`.Button` spaces an icon from its label with `gap: 7px`. `HeaderDropdown`
also sets `margin-left: 7px` on the toggle's label, which predates that gap
and now adds to it, so those toggles sit 14px from their icon while every
other control in the same list sits at 7px.

That went unnoticed while the drawer had no labelled icon rows to compare
against. rc.8 made search a labelled button and scoped the icon-only collapse
to `@media @tablet-up`, so the drawer now shows several labelled rows at once
and the odd one out is visible.

Dropping the margin lets `gap` do the spacing on its own. Verified on a
2.0.0-rc.8 install at 390px: search, flags, theme switcher and notifications
all move onto the same 47.5px label edge. Nothing changes above `@tablet-up`,
where these toggles collapse to `.Button--icon()` and hide their labels.
@karl-bullock
karl-bullock requested a review from a team as a code owner September 24, 2026 01:26
@imorland imorland added this to the 2.0-pre milestone Oct 4, 2026
@imorland
imorland merged commit 868bd83 into flarum:2.x Oct 4, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2.x] Drawer control labels are misaligned by a legacy HeaderDropdown label margin

2 participants