Social Icons: custom icon background colour does not persist when switching between block styles
Description
If a background colour has been set for a social icon using the Default custom style, it does not persist when switching between the block's custom styles: Default and Logos Only.
I was surprised to see the the Default background colour was not reinstated when switching between styles but am unsure if this is intentional behaviour.
Step-by-step reproduction instructions
- Insert a Social Icons block
- Add some icons.
- Switch between the Styles presets — from Default to Logos Only, and back to Default — and notice the default icon colours are retained.
- Set a custom icon colour and background colour via the Icon background color picker.
- Repeat step 3. Notice the background colour is not retained when returning to the Default style.
Screenshots, screen recording, code snippet
Default icon colours:

Custom icon colours:

Environment info
- WP 5.8, Gutenberg 11.4.1, theme in screen caps is custom but can replicate in TT1 Blocks.
- Chrome 93.0.4577.63
- Windows 10 on desktop
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The style "Logos Only" is for displaying the logos as styled by the logo designer.
You can adjust the styles in your themes style.css or register a new block style, which uses styles from your themes style.css.
Thanks for the comment @mkkeck but it doesn't seem to address the issue I've described. I'm not concerned with the Logos Only custom style, at all. The issue I'm looking for clarity on is whether it's intentional for a user-selected or preset background colour to be cleared when switching between Default and Logos Only styles.
The issue I'm looking for clarity on is whether it's intentional for a user-selected or preset background colour to be cleared when switching between Default and Logos Only styles.
I try to explain. The "logo only" removes the background colors based on the coded block style in the core/social-link. This behavior exist since the block exist. Block styles 'default', 'logo only' etc. are predefined styles for quick setting colors, backgrounds, shapes, etc in batch mode. So user can select a predefined style, and need only adjust settings which are required for specific icons. By block style design, so the 'logo only' removes all background and don't let you adjust a background color for an individual icon.
That's why I have suggested you to adjust your theme styles.css and / or register a new block style for your needs.
I would suggest that it should better documented and the color panel for background should removed on seleted block style 'logo only'?
I think the confusing aspect of this behaviour is that with the default colors the default style background color becomes the icon color when switching styles from default to logos only.
When either a background color or an icon color is selected, then it behaves differently when switching from default style to logos only, the background color does not become the icon color. The icon color is retained and the background disappears as expected.
@Sandstromer Okay, now I see:
The block style 'Logo Only' should also reset the color?
The block style 'Logo Only' should also reset the color?
No, when the icon color is changed, and then you switch from default style to 'Logos Only', the icon color will stay the same as your selection.
Let me explain a different way: in the second gif above my expectation was that, on switching back to Default, I would not have to manually reset the background colour to return to the starting state. I haven't previously thought of block styles as encouraging destructive changes. The colour persists across the styles switch, and, while I appreciate the background colour picker disappears for the Logos Only style, it feels like a potentially poor experience for someone who decides to test out a different presentation style but then switches back to Default. They'll lose their background colour customisation for Default in the process of doing so.
@chthonic-ds I agree that does seem like an issue that should be fixed.
In case anyone participating here would like to test it out, a PR (#34834) has been opened to fix this. You can test it on http://gutenberg.run/34834. Seems to resolve the issue and I've not been able to get it to misbehave.
Thank you, @stokesman! I've tested and can confirm #34834 appears to resolve this issue.