feat(author-profile-social): add support for colors, block spacing, brand style#4509
feat(author-profile-social): add support for colors, block spacing, brand style#4509rbcorrales merged 56 commits intotrunkfrom
Conversation
Co-authored-by: Laurel <laurel.fulford@automattic.com>
Co-authored-by: Laurel <laurel.fulford@automattic.com>
…lock.php Co-authored-by: Laurel <laurel.fulford@automattic.com>
|
Removing the review label since there are still changes requested. I think Thomas might be AFK for a few days, so @laurelfulford feel free to incorporate those markup changes you suggested, since you might be more familiar with that than me 😅 Otherwise, I can take a stab at that at some point later next week. |
|
Thanks @rbcorrales! Taking a swing at updating that now - I think @thomasguillot tackled everything else 🙂 |
|
I think I got the block markup sorted in acfc2ea -- the colour/icon blocks still had to work the original way, but the margins and gap should now be coming from WordPress magic! |
…lockGap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
rbcorrales
left a comment
There was a problem hiding this comment.
@laurelfulford Thanks for making these improvements. I found two issues while testing with how the block behaves in the editor:
1. Block Spacing control wasn't working for me in the editor
The block uses <InnerBlocks> as a child of the <ul> wrapper, but WordPress injects layout classes (is-layout-flex, scoped container classes) only through useInnerBlocksProps. Without those classes on the wrapper, the scoped gap CSS generated by the Block Spacing control has no matching selector, so changing the slider has no visible effect in the editor. The frontend is fine because WP handles layout classes server-side.
2. Default icon gap was too wide
With native WP layout, the block inherits the theme's global blockGap (2rem in newspack-block-theme), which is way too much space between small circular icons. The old code defaulted to --wp--preset--spacing--20 (0.5rem).
Core's social-links block gets its tight default from a blockGap entry in the block theme's theme.json, but our block doesn't have one, and we shouldn't require every theme to add it.
So, I pushed a fix in b100210 with two changes:
-
Switched from
<InnerBlocks>touseInnerBlocksProps, same pattern Core'ssocial-linksuses. This causes WP to inject the layout classes into the wrapper<ul>, so the Block Spacing control works in the editor. Also removed the now-redundantdisplay: flexrules fromeditor.scsssinceis-layout-flexhandles that. -
Added a
wp_theme_json_data_blocksfilter that sets a defaultblockGapofspacing-20for this block. This sits at the "blocks" layer in the theme.json cascade (default < blocks < theme < user), so themes can still override it, and user block spacing overrides work correctly. I went with this approach over CSS because theme.json-level styles get the right specificity and cascade position automatically.
block-spacing-test.mov
One thing to be aware of is that the Block Spacing slider shows empty/leftmost on a freshly inserted block, even though the gap is visually correct (8px). This is expected WP behavior for theme.json-level defaults. The slider only reflects explicitly saved block attributes, not inherited defaults.
Unrelated, but I noticed Core's social-links block has a similar issue: once you change the Block Spacing from the default, the gap renders without any spacing in the editor regardless of the value:
core-social-test.mov
I'm going to approve the PR since it's working fine with our collective changes on my end 😄, but feel free to let me know if there's something that needs updating.
|
Thanks @rbcorrales! I took the latest for a spin and retested the sizing/spacing, everything looks good to me! Thank you for taking this one to the finish line, I think it's good to go! 🙂 |
|
I'll go ahead and merge it so we can get this closed. Thanks! |
|
Hey @thomasguillot, good job getting this PR merged! 🎉 Now, the Please check if this PR needs to be included in the "Upcoming Changes" and "Release Notes" doc. If it doesn't, simply remove the label. If it does, please add an entry to our shared document, with screenshots and testing instructions if applicable, then remove the label. Thank you! ❤️ |
# [6.37.0-alpha.1](v6.36.1...v6.37.0-alpha.1) (2026-04-02) ### Bug Fixes * **card-settings-group:** change default actionType from chevron to none ([#4610](#4610)) ([00505ed](00505ed)) * **post-date:** preserve classic theme markup and fix archive titles ([#4602](#4602)) ([c5fb825](c5fb825)) * remove removal of block visibility ([#4595](#4595)) ([9396379](9396379)) ### Features * **access-control:** filter available lists by content restrictions ([#4589](#4589)) ([959127f](959127f)), closes [#4581](#4581) [#4583](#4583) [#4590](#4590) * **access-control:** premium newsletters UI ([#4577](#4577)) ([6f8c891](6f8c891)), closes [#4581](#4581) [#4583](#4583) [#4590](#4590) * **author-profile-social:** add support for colors, block spacing, brand style ([#4509](#4509)) ([21cf4c9](21cf4c9)) * campaigns wizard light UI refresh ([#4588](#4588)) ([6078c4b](6078c4b)) * **color-picker:** simplify component to use basecontrol ([#4581](#4581)) ([ff677ea](ff677ea)) * **components:** add CardFeature component ([#4583](#4583)) ([5aabb18](5aabb18)) * **content-gate:** institution management ui ([#4582](#4582)) ([ae88750](ae88750)) * **content-gate:** institutional access redirect and loading UX ([#4593](#4593)) ([548d236](548d236)) * **content-gate:** institutions ([#4574](#4574)) ([49b0c05](49b0c05)) * **content-gate:** personalized institutional access verification page ([#4596](#4596)) ([0eed591](0eed591)) * **image-upload:** simplify component to use basecontrol; remove info prop ([#4580](#4580)) ([d51eb54](d51eb54)) * **integrations:** add ActionScheduler group handling ([#4559](#4559)) ([411732a](411732a)) * **integrations:** promoted fields for content gate and campaign segmentation ([#4601](#4601)) ([f943df2](f943df2)) * **newspack-ui:** add stack layout and color utility classes ([#4600](#4600)) ([1934067](1934067)) * **post-date:** centralize date features from theme into plugin ([#4579](#4579)) ([19f15eb](19f15eb)) * **sync:** prevent stale data on retry, improve logging and error handling ([#4562](#4562)) ([5467f34](5467f34)) * **tags:** add private tags feature ([#4507](#4507)) ([06d7711](06d7711)) * **yoast:** add primary category utility and settings toggle ([#4563](#4563)) ([4b396c3](4b396c3))
|
🎉 This PR is included in version 6.37.0-alpha.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [6.37.0](v6.36.3...v6.37.0) (2026-04-13) ### Bug Fixes * **card-settings-group:** change default actionType from chevron to none ([#4610](#4610)) ([00505ed](00505ed)) * **post-date:** preserve classic theme markup and fix archive titles ([#4602](#4602)) ([c5fb825](c5fb825)) * remove removal of block visibility ([#4595](#4595)) ([9396379](9396379)) ### Features * **access-control:** filter available lists by content restrictions ([#4589](#4589)) ([959127f](959127f)), closes [#4581](#4581) [#4583](#4583) [#4590](#4590) * **access-control:** premium newsletters UI ([#4577](#4577)) ([6f8c891](6f8c891)), closes [#4581](#4581) [#4583](#4583) [#4590](#4590) * **author-profile-social:** add support for colors, block spacing, brand style ([#4509](#4509)) ([21cf4c9](21cf4c9)) * campaigns wizard light UI refresh ([#4588](#4588)) ([6078c4b](6078c4b)) * **color-picker:** simplify component to use basecontrol ([#4581](#4581)) ([ff677ea](ff677ea)) * **components:** add CardFeature component ([#4583](#4583)) ([5aabb18](5aabb18)) * **content-gate:** institution management ui ([#4582](#4582)) ([ae88750](ae88750)) * **content-gate:** institutional access redirect and loading UX ([#4593](#4593)) ([548d236](548d236)) * **content-gate:** institutions ([#4574](#4574)) ([49b0c05](49b0c05)) * **content-gate:** personalized institutional access verification page ([#4596](#4596)) ([0eed591](0eed591)) * **image-upload:** simplify component to use basecontrol; remove info prop ([#4580](#4580)) ([d51eb54](d51eb54)) * **integrations:** add ActionScheduler group handling ([#4559](#4559)) ([411732a](411732a)) * **integrations:** promoted fields for content gate and campaign segmentation ([#4601](#4601)) ([f943df2](f943df2)) * **newspack-ui:** add stack layout and color utility classes ([#4600](#4600)) ([1934067](1934067)) * **post-date:** centralize date features from theme into plugin ([#4579](#4579)) ([19f15eb](19f15eb)) * **sync:** prevent stale data on retry, improve logging and error handling ([#4562](#4562)) ([5467f34](5467f34)) * **tags:** add private tags feature ([#4507](#4507)) ([06d7711](06d7711)) * **yoast:** add primary category utility and settings toggle ([#4563](#4563)) ([4b396c3](4b396c3))
|
🎉 This PR is included in version 6.37.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
This PR adds a bunch of enhancements to the block:
We are extracting the gaps and colours to apply them to the actual link
video.mp4
How to test the changes in this Pull Request:
Other information: