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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduce a "Default" option for icon size in the toolbar dropdown.
Ensure the "Default" state maps to undefined in the size attribute instead of hardcoding has-normal-icon-size
Ensure that resetting the size removes the has-normal-icon-size class.
Why?
Currently, when the icon size is set and reset, the has-normal-icon-size class remains in the markup. This overrides custom styles set via theme.json or additional CSS due to higher specificity.
By introducing an explicit "Default" option that doesn't apply a class, this change ensures the block respects styles defined in theme.json. It also improves clarity in the UI, indicating when the default size is being used.
How?
Added a "Default" option with an empty string value ('') to the SelectControl options.
Updated logic to treat this as undefined internally.
Ensured that selecting or resetting to "Default" results in no size class being written to the block.
Testing Instructions
Insert a Social Links block into a post or page.
Open the block settings sidebar.
Expand the "Icon size" dropdown:
Confirm that "Default" is now an option.
Select other sizes like Small, Normal, Large.
Confirm the correct class is applied (e.g., .has-small-icon-size).
Switch back to "Default" or Reset the size:
Confirm the class is removed from markup.
Add font size overrides in theme.json for the Social Links block.
Confirm that they now apply correctly when "Default" is selected.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.
Unlinked Accounts
The following contributors have not linked their GitHub and WordPress.org accounts: @EldarAgalarov.
[Block] SocialAffects the Social Block - used to display Social Media accounts[Type] BugAn existing feature does not function as intended
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #70318
This PR updates the SocialLinksEdit component to:
undefined
in the size attribute instead of hardcodinghas-normal-icon-size
has-normal-icon-size
class.Why?
Currently, when the icon size is set and reset, the
has-normal-icon-size
class remains in the markup. This overrides custom styles set via theme.json or additional CSS due to higher specificity.By introducing an explicit "Default" option that doesn't apply a class, this change ensures the block respects styles defined in theme.json. It also improves clarity in the UI, indicating when the default size is being used.
How?
Testing Instructions
Testing Instructions for Keyboard
Same
Screenshots or screencast
When the following style is added to theme.json
After Icon size is reset