Skip to content

Consider adding text alignment support to the List block #39071

Open

Description

@richtabor

What problem does this address?

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.

CleanShot 2022-02-24 at 13 29 12@2x

Activity

  1. added
    [Type] Enhancement
    [Block] List
    on Feb 24, 2022
  2. carolinan commented on Jun 10, 2022

    @carolinan
    Contributor

    Should the number or bullet also be aligned?

  3. ellatrix commented on Jul 12, 2024

    @ellatrix
    Member
  4. t-hamano commented on Jul 12, 2024

    @t-hamano
    Contributor

    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:

    image

    What is expected of this issue is to center the numbers and bullets left and right as shown below?

    image

  5. carolinan commented on Jul 16, 2024

    @carolinan
    Contributor

    Personally I would always expect the bullets to be in close proximity to the text, for the readability. So option two.

  6. t-hamano commented on Jul 16, 2024

    @t-hamano
    Contributor

    So option two.

    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:

    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] List[Type] Enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions