Skip to content

Conversation

Smit2808
Copy link
Contributor

What?

Social icons block has center align issue in some themes like Twenty Twenty-Two and TT1 Blocks. And by discussing with core member @sabernhardt, we conclude that this issue is of block not of the theme.

PR will fix: #43048

I created this PR because @sabernhardt, told me some changes. So I created a new PR with those changes. Please review it.

How?

In themes like Twenty Twenty-Two and TT1 Blocks, the justify-content: flex-start; style is added to the container class so it was overriding the social icon block center CSS.

/* block-library/style.css */
.wp-block-social-links.aligncenter {
display: flex;
justify-content: center;
}

So to fix this issue, I created a strong hierarchy to override the justify-content: flex-start; style.

Testing Instructions

  1. Activate the Twenty Twenty-Two theme.
  2. Create a new post and insert a social icon block. Note: If you add the social icons block in the Site Editor, the option to align left/center/right is not always available.
  3. Select "Align center" in the dropdown. This does not center the icons in the editor.

Screenshots or screencast

@Smit2808 Smit2808 requested a review from ajitbohra as a code owner August 10, 2022 13:30
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Block] Social Affects the Social Block - used to display Social Media accounts labels Aug 10, 2022
@github-actions github-actions bot added the Stale label Feb 7, 2023
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thank you for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Social icons block not centered in the editor when choosing "Align center"
3 participants