Skip to content

[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 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-textalign
Open

[3.0] Theme split (wave 8, part 3) — align text with start and end instead of left and right#9570
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-rtl-textalign

Conversation

@albertlast

@albertlast albertlast commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Description

Part 3 of wave 8 of the #7933 split.

text-align: start and text-align: end follow the writing direction, so the eleven
places where rtl.css did nothing except mirror the alignment no longer need an override
at all.

Same rule as part 2: only exact mirrors are converted — the base stylesheet says
left and rtl.css says right, or the reverse.

Left alone on purpose:

  • alignments rtl.css sets where the base sheet has none, which a single logical
    declaration cannot express
  • the deliberate ones. code.bbc_code and pre.file_content stay text-align: left
    in 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.days shares a rule with #month_grid td.days, and only the first has a
mirror. It turned out to be safe anyway: the mini calendar re-declares
text-align: center immediately below at equal specificity, so the shared value never
reaches it.

rtl.css aligned #stats tr.windowbg th.lefttext and #stats tr.titlebg th.lefttext
in one rule, and only the windowbg half has a rule to mirror — the titlebg half is
aligned by the generic .lefttext instead. Removing the pair wholesale would have quietly
dropped the flip for titlebg, so that half keeps its override, now standing alone with a
comment explaining why.

How this was checked

Same criterion and method as part 2 — nothing moves in either direction — with
text-align and direction recorded alongside the geometry, on 28 pages, captured back
to back across a stash.

elements differences
left-to-right 8996 119, all the text-align keyword
right-to-left 8995 119, all the text-align keyword

No geometry moved in either direction.

The count is larger than the eleven converted rules because text-align inherits, so
every child reports the new keyword too. In right-to-left the changes read
right -> start and left -> end, which are the same rendering; in left-to-right they
read left -> start and right -> end.

rtl.css goes from 480 lines to 453.

Issues References (Fixes|Related|Closes)

Related to #7933.


On the ordering of these four

These were originally stacked. They are not any more — each of #9569, #9570, #9571 and
#9572 now branches from release-3.0 on its own and contains exactly one commit, so each
diff shows only its own property and nothing else. They can be reviewed in any order.

They cannot all be merged without a rebase in between, and that is worth being straight
about. One rtl.css rule usually mirrors several properties at once, so these PRs edit
some of the same declaration blocks. release-3.0 has:

#poll_options dl.options dt { float: right; clear: right; }
#poll_options dl.options dd { float: right; text-align: left; }

#9569 removes both floats, #9570 removes the text-align, #9571 removes the clear
and a rule only disappears once its last declaration is gone. Merging any one of these is
fine; after that I will rebase the rest, which is a few minutes of work each time. Of the
six pairs, text-align+clear and clear+margins merge cleanly as they stand; the
float one overlaps with all three, so merging that one first costs the least.

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.

Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
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