Skip to content

[3.0] Theme split (wave 4, part 5) — move the collapse toggles out of their headings - #9390

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-bar-layout
Open

[3.0] Theme split (wave 4, part 5) — move the collapse toggles out of their headings#9390
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-bar-layout

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Part of the split of #7933, wave 4 part 5.

Every collapsible panel in the forum puts its collapse toggle inside the
heading and floats it right:

<h3 class="catbg">
	<span id="group_requests_toggle" class="… floatright" …></span>
	<a href="…">Membergroup Requests</a>
</h3>

So a control that acts on the whole panel is a child of the panel's title. It
reads oddly to a screen reader, and it means the heading cannot simply be the
heading.

This makes .cat_bar and .title_bar flex rows so a sibling can sit beside the
heading, and moves the toggles out. Twelve of them, across nine templates.

Only where the bar is a div. .title_bar is also put on a <tr> — the
permissions table is one — and turning that into a flex row would take the table
apart. The selectors are div.cat_bar and div.title_bar for that reason, and I
checked: tr.title_bar still computes to display: table-row.

The category description on the board index is a sibling of its heading too, so it
gets flex-basis: 100% to stay under the heading rather than moving beside it.

One small thing fixed on the way

The package browser's advanced toggle carried no toggle_down or toggle_up
class at all — only floatright. Those classes are what create the ::before
that draws the icon, so it was an empty span with nothing in it. It now starts
collapsed, like the identical toggle on the newsletter page, and draws a 17×17
icon.

(You need #9389 to see that page at all on a forum that has never fetched the
version list from simplemachines.org.)

Testing

The toggles land in the same place. Board index, measured on both branches:

release-3.0 this branch
category toggle x 619, 28×21 x 619, 28×21
info centre toggle x 602, 28×20 x 602, 28×21
category bar 612×36 612×35
category heading 612 wide 571 wide

The bar is a pixel shorter and the toggle sits two pixels higher, because it is
now centred in the row rather than floated inside a padded heading. The heading is
narrower because the toggle takes its own space instead of overlapping it.

Across the affected pages, every toggle is 12–13px from the end of its bar, clear
of the heading (no overlap), on the same row, and drawing its icon:

  • moderation centre — all four
  • permissions → advanced options
  • search → choose boards
  • personal messages → choose labels
  • newsletters → advanced
  • package browser → advanced
  • board index — category and info centre

They still work: clicking the membergroup-requests toggle collapses the panel and
flips toggle_uptoggle_down; clicking the newsletter one expands its panel
and flips the other way.

RTL is measured rather than assumed — the toggle is 13px from the right edge under
dir="ltr" and 13px from the left edge under dir="rtl".

composer lint is clean on all nine templates.

Not done here

The theme branch's version of this block also tokenises the two bars — roughly
forty new --catbg-* custom properties. That is a separate change and wants its
own PR; one of them (--catbg-border-color where --catbar-border-color is
meant) is exactly the undefined-token case discussed on #7933, so it needs reading
rather than copying. Only the layout is taken here.

Issues References (Fixes|Related|Closes)

Related to #7933

Every collapsible panel puts its toggle inside the heading and floats it right, so
a control that acts on the whole panel is a child of the panel's title. It reads
oddly to a screen reader and it means the heading cannot simply be the heading.

Makes .cat_bar and .title_bar flex rows so a sibling can sit beside the heading,
and moves the toggles out. Only where the bar is a div: .title_bar is also put on
a <tr>, and turning that into a flex row would take the table apart.

The category description on the board index is a sibling of its heading too, and
belongs under it rather than beside it, so it gets a full-width basis.

One small thing fixed on the way: the package browser's advanced toggle carried no
toggle_down or toggle_up class at all, only floatright, so it was an empty span
with nothing to draw. It now starts collapsed like the identical toggle on the
newsletter page.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast albertlast mentioned this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant