Skip to content

[3.0] Theme split (wave 8, part 5) — logical margins and padding where the sides mirror - #9572

Merged
jdarwood007 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-box
Sep 7, 2026
Merged

jdarwood007 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-box

Conversation

@albertlast

@albertlast albertlast commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Part 5 of wave 8 of the #7933 split.

margin-inline and padding-inline follow the writing direction, so the twenty rules
where rtl.css did nothing but swap the left and right values no longer need an override.
This is the largest single reduction in the wave.

What qualifies

A rule qualifies only when the right-to-left values are the exact mirror of the
left-to-right ones — same top and bottom, left and right swapped.

  • four-value shorthands become a block pair and an inline pair, so
    margin: 0 0 4px 2% becomes margin-block: 0 4px and margin-inline: 2% 0
  • where the base sheet used a single longhand it stays a single longhand, so
    margin-left becomes margin-inline-start

Everything else is left alone. rtl.css holds a good many spacing rules that are not
mirrors — they change the value as well as the side (.cat_bar .desc is 8px on one side
in one direction and 13px in the other), or they add spacing the base sheet does not have
at all. No logical declaration can express two different values at once, so those stay.

How this was checked

Same method as parts 2 to 4, on 29 pages captured back to back across a stash.

elements differences
left-to-right 9735 0
right-to-left 9736 0

Nothing changed at all this time — not even a keyword. Unlike float and text-align,
getComputedStyle resolves logical margins and padding back to physical values, so the
reported numbers are identical before and after. This is the strongest result of the wave:
the two stylesheets are indistinguishable to the browser.

One measurement note, since it would otherwise look like a real difference. A first run
showed four differences on the statistics page, all on the counter <span>s inside
dl.stats dd. That was the counters themselves changing value between runs — the text got
one character wider — and not the CSS. Two captures taken with identical code showed the
same four, and re-running the pair once the counters settled gave the zero above.

rtl.css goes from 442 lines to 365 — down from 624 at the start of the wave.

Issues References (Fixes|Related|Closes)

Related to #7933.



Rebased now that the rest of the wave has landed

This is the last of the four. #9569, #9570 and #9571 are merged, and because one rtl.css
rule usually mirrors several properties at once, those merges touched some of the same
declaration blocks as this one — so it needed rebasing to go green again.

Rather than resolve the conflicts, the conversion was re-derived from scratch against
current release-3.0: the same scripts recomputed which overrides are exact mirrors, and
found the same 14 margin and 9 padding rules as before. The only difference in the result
is that 17 rtl.css rules now disappear entirely rather than 14, because the merged parts
had already removed their other declarations and this takes the last one.

Re-verified on a freshly installed forum against current release-3.0, 24 pages, 5110
elements, captured back to back in both writing directions:

differences
left-to-right 0
right-to-left 0

🤖 Generated with Claude Code

margin-inline and padding-inline follow the writing direction, so the twenty
rules where rtl.css did nothing but swap the left and right values no longer
need an override.

A rule qualifies only when the right-to-left values are the exact mirror of the
left-to-right ones: the same top and bottom, and the left and right swapped.
Four-value shorthands become a block pair and an inline pair, so
margin: 0 0 4px 2% turns into margin-block: 0 4px and margin-inline: 2% 0.
Where the base sheet used a single longhand it stays a single longhand, so
margin-left becomes margin-inline-start.

Everything else is left as it is. rtl.css contains a good many spacing rules
that are not mirrors at all - they change the value as well as the side, or
they add spacing the base sheet does not have - and no logical declaration can
express two different values at once.

Checked on 24 pages, capturing float, clear, text-align, direction, the inline
margins and padding and the bounding rectangle of every element, before and
after, back to back in both writing directions: 5110 elements and zero
differences either way. getComputedStyle resolves logical box properties back
to physical ones, so even the reported values are identical.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@jdarwood007
jdarwood007 merged commit f5b2bd2 into SimpleMachines:release-3.0 Sep 7, 2026
9 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 participants