Skip to content

Conversation

aaronrobertshaw
Copy link
Contributor

Fixes: #48253

What?

Updates the selector used for the Avatar block's global border styles so they target the same element as the block instance styles are applied to.

Why?

Without this fix global border styles for the Avatar block target the wrapper instead of the inner image.

How?

Define the correct selector for the border feature via the Selectors API.

Testing Instructions

  1. Edit a template or post and add a few Avatar blocks including one that links to the user profile
  2. Switch to the Site Editor > Global Styles > Blocks > Avatar
  3. Apply a global styles border
  4. Switch back to the editor and ensure the global border styles target the Avatar block's img element
  5. Save the post or template and confirm the correct styling on the frontend
  6. Test that you can override the global border styles with block instance border styles still

Screenshots or screencast

Before After
Screenshot 2023-07-27 at 2 46 48 pm Screenshot 2023-07-27 at 2 47 02 pm
Screen.Recording.2023-07-27.at.2.50.09.pm.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Bug An existing feature does not function as intended [Block] Avatar Affects the Avatar Block labels Jul 27, 2023
@aaronrobertshaw aaronrobertshaw self-assigned this Jul 27, 2023
Copy link
Member

@kevin940726 kevin940726 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@cbravobernal cbravobernal left a comment

Choose a reason for hiding this comment

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

Working as expected. Thanks!

@cbravobernal cbravobernal merged commit a1c149d into trunk Jul 27, 2023
@cbravobernal cbravobernal deleted the fix/avatar-global-border-styles branch July 27, 2023 10:13
@github-actions github-actions bot added this to the Gutenberg 16.4 milestone Jul 27, 2023
justintadlock added a commit to x3p0-dev/x3p0-ideas that referenced this pull request May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Avatar Affects the Avatar Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Global Styles: Border customisation is not applied correctly
3 participants