Page MenuHomePhabricator

Table: align numbers to the right in both reading directionalities
Closed, ResolvedPublic1 Estimated Story Points

Description

The Table component allows users to set the text alignment for a column (or individual cell) to end, which is recommended for numbers. However, numbers should actually be aligned to the right in both reading directions.


Acceptance criteria

  • A new option for the textAlign property of the TableColumn type, 'right', is added
  • The Table component is updated to use this class to set text-align: right, a style which should not be flipped for RTL
  • The Table demo page should be updated to explain this new option and the difference between 'end' and 'right'
  • The demos on the Table demo page and sandbox page should be updated to use 'right' alignment for numbers

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1029216 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Table: Add textAlign option for numbers

https://gerrit.wikimedia.org/r/1029216

AnneT set the point value for this task to 1.EditedWed, May 8, 9:03 PM

The new cdx-table__cell--align-right class's styles don't actually work yet for these reasons:

  • Since the text-align: right style is not flipped, it does not get a [dir] selector added to it, therefore the selector with text-align: left is more specific and outweighs it. This only matters on the docs site and sandbox, but...the demos need to work.
  • Even if you add specificity to the --right class, it doesn't work for the th elements in the thead because of some flex styles there

I'd like to wait until this patch is complete before resolving the second item, because any changes I make to these th elements will clash with Lauralyn's code changes.

Change #1029216 merged by jenkins-bot:

[design/codex@main] Table: Add `textAlign` option for numbers

https://gerrit.wikimedia.org/r/1029216

Change #1031487 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] Table: Clean up alignment classes

https://gerrit.wikimedia.org/r/1031487

Change #1031487 merged by jenkins-bot:

[design/codex@main] Table: Clean up alignment classes

https://gerrit.wikimedia.org/r/1031487

Change #1032095 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update Codex from 1.5.0 to 1.6.0

https://gerrit.wikimedia.org/r/1032095

Change #1032095 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from 1.5.0 to 1.6.0

https://gerrit.wikimedia.org/r/1032095

Volker_E renamed this task from Table: align numbers to the right in both reading directions to Table: align numbers to the right in both reading directionalities.Thu, May 16, 2:06 AM
Volker_E closed this task as Resolved.
Volker_E removed a project: Patch-For-Review.