Skip to content

feat(author-profile-social): add support for colors, block spacing, brand style#4509

Merged
rbcorrales merged 56 commits intotrunkfrom
update/author-profile-social
Apr 1, 2026
Merged

feat(author-profile-social): add support for colors, block spacing, brand style#4509
rbcorrales merged 56 commits intotrunkfrom
update/author-profile-social

Conversation

@thomasguillot
Copy link
Copy Markdown
Contributor

All Submissions:

Changes proposed in this Pull Request:

This PR adds a bunch of enhancements to the block:

  • New style: "Brand" that inherits the brand's colours
  • If default style selected: User can control Icon and icon background colours (I used Core's Color panel instead of custom one because of ordering. I renamed "Text" and "Background" to "Icon color" and "Icon background" with some JS)
  • We now support block spacing
  • I removed the padding setting

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:

  1. Add an author profile block
  2. Edit the social links
  3. Switch to this branch and refresh
  4. You should see more settings in the sidebar.
  5. Test the colours
  6. The spacings (gap and margin)
  7. Test brand vs default

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

rbcorrales and others added 30 commits February 5, 2026 00:30
@github-actions github-actions Bot added the [Status] Needs Changes or Feedback The issue or pull request needs action from the original creator label Mar 10, 2026
@laurelfulford laurelfulford self-requested a review March 19, 2026 17:32
@rbcorrales rbcorrales removed the [Status] Needs Review The issue or pull request needs to be reviewed label Mar 21, 2026
@rbcorrales
Copy link
Copy Markdown
Member

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.

@laurelfulford
Copy link
Copy Markdown
Contributor

Thanks @rbcorrales! Taking a swing at updating that now - I think @thomasguillot tackled everything else 🙂

@laurelfulford
Copy link
Copy Markdown
Contributor

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>
Copy link
Copy Markdown
Member

@rbcorrales rbcorrales left a comment

Choose a reason for hiding this comment

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

@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).

Image

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.

Image

So, I pushed a fix in b100210 with two changes:

  1. Switched from <InnerBlocks> to useInnerBlocksProps, same pattern Core's social-links uses. 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-redundant display: flex rules from editor.scss since is-layout-flex handles that.

  2. Added a wp_theme_json_data_blocks filter that sets a default blockGap of spacing-20 for 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.

@github-actions github-actions Bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Changes or Feedback The issue or pull request needs action from the original creator labels Mar 30, 2026
@laurelfulford
Copy link
Copy Markdown
Contributor

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! 🙂

@rbcorrales rbcorrales dismissed laurelfulford’s stale review April 1, 2026 17:42

Dismissing stale review.

@rbcorrales
Copy link
Copy Markdown
Member

I'll go ahead and merge it so we can get this closed. Thanks!

@rbcorrales rbcorrales merged commit 21cf4c9 into trunk Apr 1, 2026
9 checks passed
@rbcorrales rbcorrales deleted the update/author-profile-social branch April 1, 2026 17:43
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

Hey @thomasguillot, good job getting this PR merged! 🎉

Now, the needs-changelog label has been added to it.

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! ❤️

matticbot pushed a commit that referenced this pull request Apr 2, 2026
# [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))
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 2, 2026

🎉 This PR is included in version 6.37.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Apr 13, 2026
# [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))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 6.37.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants