You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider adding text alignment support to the List block #39071
While other text-related/content blocks support text alignment, the List block is omitted. Let's consider adding text alignment support to the List block, just like the Paragraph block supports.
Currently the only way to modify it's text alignment is to do so manually with a utility class.
If we just want a UI for applying text-align to the List block, the new textAlign support introduced in #59531 will do the trick. However, there is currently an issue that we cannot override alignments applied via the global styles from a block instance, as we are trying to solve in #62260.
Furthermore, textAlign doesn't take numbers and bullets into account, so we'll end up with something like this:
What is expected of this issue is to center the numbers and bullets left and right as shown below?
Achieving this would be difficult with block support. This is because, generally, if we want to center a list that includes bullets or numbers left and right, we need to apply display:inline-block to the list and text-align:center to the parent element.
By the way, this layout can also be achieved by wrapping the List block with a Row block with Justification set to center:
Activity
carolinan commentedon Jun 10, 2022
Should the number or bullet also be aligned?
ellatrix commentedon Jul 12, 2024
Cc @t-hamano
t-hamano commentedon Jul 12, 2024
If we just want a UI for applying
text-alignto the List block, the newtextAlignsupport introduced in #59531 will do the trick. However, there is currently an issue that we cannot override alignments applied via the global styles from a block instance, as we are trying to solve in #62260.Furthermore,
textAligndoesn't take numbers and bullets into account, so we'll end up with something like this:What is expected of this issue is to center the numbers and bullets left and right as shown below?
carolinan commentedon Jul 16, 2024
Personally I would always expect the bullets to be in close proximity to the text, for the readability. So option two.
t-hamano commentedon Jul 16, 2024
Achieving this would be difficult with block support. This is because, generally, if we want to center a list that includes bullets or numbers left and right, we need to apply
display:inline-blockto the list andtext-align:centerto the parent element.By the way, this layout can also be achieved by wrapping the List block with a Row block with
Justificationset tocenter: