Skip to content

Alignment: blocks using alignment should apply data-align consistently #7908

@designsimply

Description

@designsimply

Moved from #4010 h/t @bradyvercher.

Edit Wrapper Data Attribute

Most of the blocks apply a data-align attribute to the edit wrapper with the alignment value similar to this:

getEditWrapperProps( attributes ) {
    const { align } = attributes;
    if ( 'left' === align || 'right' === align || 'wide' === align || 'full' === align ) {
        return { 'data-align': align };
    }
}

Center aligning never seems to change the value of the data attribute for the edit wrapper despite it being a valid value for most blocks. It seems like this should be applied consistently in case themes treat aligncenter different than alignnone or an empty value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions