[3.0] Theme split (wave 8, part 3) — align text with start and end instead of left and right - #9570
Open
albertlast wants to merge 3 commits into
Open
Conversation
rtl.css exists to flip physical properties for right-to-left languages, so every rule in it is an override of something another stylesheet draws. Sixteen of them override markup the theme stopped emitting, and have been dead for some time: - the event editor was rewritten and now draws no ul at all, which takes out the whole "edit event section" block plus the two #event_main rules - .bbc_standard_quote and .bbc_alternate_quote were checked and kept: those class names are built at runtime in BBCodeParser, so grepping for them finds nothing even though the markup does emit them - the rest name ids and classes that appear nowhere in Themes/ or Sources/: #postbuttons_upper, .reportlinks, #personal_messages span#author and span#topic_title, h3.search_hd, #popularposts, #popularactivity, .topic .mod_icons, .stats_icon, .search_results_posts .buttons and #helpmain h3.section Checked by loading 24 pages as an administrator with a right-to-left language active, including the event editor, the statistics centre, help, search results and the personal messages area: 7086 elements, and not one of the removed selectors matches any of them. .topic .mod_icons is the counterpart of the index.css rule removed in SimpleMachines#9547, which left this copy behind. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
float: inline-start and float: inline-end follow the writing direction on their own, so a rule that uses them needs no right-to-left counterpart. This converts the 26 floats where rtl.css was doing nothing more than mirroring the value, and drops those overrides. The 26 are the ones where the override is an exact mirror: index.css and profile.css say left and rtl.css says right, or the other way round. Floats whose right-to-left value is not the mirror of the left-to-right one are left alone, because a single logical declaration cannot reproduce two different values; the same goes for the floats rtl.css adds where the base sheet has none. #post_header dt/dd shared a rule with #event_options dt/dd, and only the first pair has a mirror in rtl.css. Converting the pair together would have started mirroring the event editor, which is not mirrored today, so the rule is split and #event_options keeps a physical float with a comment saying why. Checked by recording float, clear, text-align, the inline margins and padding, and the bounding rectangle of every element on 26 pages, before and after, captured back to back so nothing else about the forum could move in between: - left-to-right: 8018 elements, the only differences are the 82 float keywords themselves. No geometry changes at all. - right-to-left: 8017 elements, 81 float keywords, and again nothing else. The keyword is expected to differ: getComputedStyle reports inline-start rather than resolving it to left or right. What matters is that every x, y, width, height, margin and padding is identical in both directions. rtl.css goes from 555 lines to 480. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
text-align: start and text-align: end follow the writing direction, so the eleven places where rtl.css did nothing but mirror the alignment no longer need an override. As with the floats, only exact mirrors are converted: the base sheet says left and rtl.css says right, or the reverse. Alignments that rtl.css sets where the base sheet has none are left alone, and so are the deliberate ones - code blocks and file contents stay left-aligned in a right-to-left language on purpose, and that rule is untouched. Two rules needed care rather than a substitution: - #main_grid td.days shares its rule with #month_grid td.days, but the mini calendar re-declares text-align: center immediately below, so the shared value never reaches it and the group is safe to convert. - rtl.css aligned #stats tr.windowbg th.lefttext and #stats tr.titlebg th.lefttext together, and only the windowbg half has a rule to mirror. The titlebg half is aligned by .lefttext instead, so it keeps its override, now with a comment saying why it is on its own. Checked the same way as the floats, capturing every element on 28 pages before and after, back to back, with text-align and direction recorded alongside the geometry: - left-to-right: 8996 elements, 119 differences, every one the text-align keyword - right-to-left: 8995 elements, 119 differences, likewise No geometry moved in either direction. The count is higher than the eleven converted rules because text-align inherits, so the children report the new keyword too. rtl.css goes from 480 lines to 453. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 29, 2026
Closed
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 3 of wave 8 of the #7933 split. Stacked on #9569, which is stacked on #9568.
text-align: startandtext-align: endfollow the writing direction, so the elevenplaces where
rtl.cssdid nothing except mirror the alignment no longer need an overrideat all.
Same rule as part 2: only exact mirrors are converted — the base stylesheet says
leftandrtl.csssaysright, or the reverse.Left alone on purpose:
rtl.csssets where the base sheet has none, which a single logicaldeclaration cannot express
code.bbc_codeandpre.file_contentstaytext-align: leftin a right-to-left language because code should not be mirrored. That rule is untouched,
and converting it would have been a real bug rather than a no-op.
Two that needed care rather than a substitution
#main_grid td.daysshares a rule with#month_grid td.days, and only the first has amirror. It turned out to be safe anyway: the mini calendar re-declares
text-align: centerimmediately below at equal specificity, so the shared value neverreaches it.
rtl.cssaligned#stats tr.windowbg th.lefttextand#stats tr.titlebg th.lefttextin one rule, and only the
windowbghalf has a rule to mirror — thetitlebghalf isaligned by the generic
.lefttextinstead. Removing the pair wholesale would have quietlydropped the flip for
titlebg, so that half keeps its override, now standing alone with acomment explaining why.
How this was checked
Same criterion and method as part 2 — nothing moves in either direction — with
text-alignanddirectionrecorded alongside the geometry, on 28 pages, captured backto back across a stash.
text-alignkeywordtext-alignkeywordNo geometry moved in either direction.
The count is larger than the eleven converted rules because
text-aligninherits, soevery child reports the new keyword too. In right-to-left the changes read
right -> startandleft -> end, which are the same rendering; in left-to-right theyread
left -> startandright -> end.rtl.cssgoes from 480 lines to 453.Issues References (Fixes|Related|Closes)
Related to #7933.