[3.0] Theme split (wave 8, part 5) — logical margins and padding where the sides mirror - #9572
Merged
jdarwood007 merged 1 commit intoSep 7, 2026
Conversation
Closed
albertlast
force-pushed
the
3.0/theme-rtl-box
branch
2 times, most recently
from
September 2, 2026 07:12
2b00196 to
76ae8eb
Compare
This was referenced Sep 2, 2026
Merged
albertlast
force-pushed
the
3.0/theme-rtl-box
branch
2 times, most recently
from
September 6, 2026 08:50
cafcf0f to
c79540a
Compare
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>
albertlast
force-pushed
the
3.0/theme-rtl-box
branch
from
September 6, 2026 19:22
c79540a to
f1bfcbb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part 5 of wave 8 of the #7933 split.
margin-inlineandpadding-inlinefollow the writing direction, so the twenty ruleswhere
rtl.cssdid 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.
margin: 0 0 4px 2%becomesmargin-block: 0 4pxandmargin-inline: 2% 0margin-leftbecomesmargin-inline-startEverything else is left alone.
rtl.cssholds a good many spacing rules that are notmirrors — they change the value as well as the side (
.cat_bar .descis8pxon one sidein one direction and
13pxin the other), or they add spacing the base sheet does not haveat 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.
Nothing changed at all this time — not even a keyword. Unlike
floatandtext-align,getComputedStyleresolves logical margins and padding back to physical values, so thereported 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 insidedl.stats dd. That was the counters themselves changing value between runs — the text gotone 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.cssgoes 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.cssrule 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, andfound the same 14 margin and 9 padding rules as before. The only difference in the result
is that 17
rtl.cssrules now disappear entirely rather than 14, because the merged partshad 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, 5110elements, captured back to back in both writing directions:
🤖 Generated with Claude Code