Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Styles for Social Icons list placeholders #56887

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

colinduwe
Copy link
Contributor

What?

Improves the appearance of the placeholders shown on the Social Icons list block.

Why?

#55296
The squares for the placeholders don't completely represent how the block will look once a user add actual social icons to the container block.

How?

A few minor style updates.

Testing Instructions

Insert a new Social Icons block. Remove focus from the block and observe that the placeholders have the correct gap between them.
You can also apply the the logos only and pill shape block style variations and the placeholders will appare the same size and shape as actual inner blocks.

Note that setting the icon color will not change the colors of the placeholders.

Testing Instructions for Keyboard

Screenshots or screencast

@colinduwe colinduwe requested a review from ajitbohra as a code owner December 8, 2023 01:45
Copy link

github-actions bot commented Dec 8, 2023

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @colinduwe! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Dec 8, 2023
@skorasaurus skorasaurus added the [Block] Social Affects the Social Block - used to display Social Media accounts label Dec 8, 2023
@apeatling
Copy link
Contributor

Can you provide a before/after image so it's clear we're looking at the right thing? Thanks.

@apeatling apeatling added the [Type] Enhancement A suggestion for improvement. label Dec 8, 2023
@colinduwe
Copy link
Contributor Author

Sure thing. First is the initial state of the placeholder. Note that there is no gap between placeholder items:
Screenshot 2023-12-08 at 3 24 35 PM
With this patch they use the theme.json gap:
Screenshot 2023-12-08 at 3 31 02 PM
Currently if you choose the "icons only" style variation there is no gap and the placeholders are too small:
Screenshot 2023-12-08 at 3 24 55 PM
Now they are the spaced and correct size:
Screenshot 2023-12-08 at 3 33 22 PM
Similar if we choose the pill style:
Screenshot 2023-12-08 at 3 25 10 PM
Corrected in this PR:
Screenshot 2023-12-08 at 3 34 46 PM
If you set a background color:
Screenshot 2023-12-08 at 3 25 54 PM
Now it is the correct color
Screenshot 2023-12-08 at 3 36 23 PM
Finally, if you choose icon only and set an icon color
Screenshot 2023-12-08 at 3 26 14 PM
Now it takes the icon color
Screenshot 2023-12-08 at 3 38 56 PM
Note that if you use the default or pill styles and set an icon color and a background color it displays the background color for the placeholders. Only if you choose the icon only style and set an icon color does the placeholder display in the icon color.

@colinduwe
Copy link
Contributor Author

I'll also note that because the placeholders are actually contained within a single list item in the social icons list container they do not respond to the block spacing controls. Let me know if you'd like me to pursue that as well.

@cbravobernal
Copy link
Contributor

I'll also note that because the placeholders are actually contained within a single list item in the social icons list container they do not respond to the block spacing controls. Let me know if you'd like me to pursue that as well.

Thanks for your contribution! It would be great if you can fix that too 💪

Copy link

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: @apeatling.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: apeatling.

Co-authored-by: colinduwe <colind@git.wordpress.org>
Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@cbravobernal cbravobernal force-pushed the fix/improve-social-icon-placeholder-styles branch from 0c6f071 to b4ccfd8 Compare October 14, 2024 13:35
cbravobernal
cbravobernal previously approved these changes Oct 14, 2024
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.

I tested and works as expected.
Updated with last trunk. It would be great to have a second pair of eyes though.

@cbravobernal cbravobernal force-pushed the fix/improve-social-icon-placeholder-styles branch from b4ccfd8 to e405e37 Compare October 15, 2024 09:47
@cbravobernal cbravobernal self-requested a review October 15, 2024 10:22
@cbravobernal cbravobernal dismissed their stale review October 15, 2024 10:23

Need to re-check

@cbravobernal
Copy link
Contributor

I've been comparing with trunk again and seems the issue is not there anymore.
@colinduwe can you please re-check if this PR is finally needed?

Sorry for the trouble! 😅

@colinduwe
Copy link
Contributor Author

I just opened https://playground.wordpress.net/ and tested 6.6 and 6.7-beta-2 and Gutenberg 19.4.0 and the placeholder is unchanged. If I look at the edit.js file for this block here

const SocialPlaceholder = (
<li className="wp-block-social-links__social-placeholder">
<div className="wp-block-social-links__social-placeholder-icons">
<div className="wp-social-link wp-social-link-twitter"></div>
<div className="wp-social-link wp-social-link-facebook"></div>
<div className="wp-social-link wp-social-link-instagram"></div>
</div>
</li>
);

it looks unchanged.

@cbravobernal
Copy link
Contributor

I just opened https://playground.wordpress.net/ and tested 6.6 and 6.7-beta-2 and Gutenberg 19.4.0 and the placeholder is unchanged. If I look at the edit.js file for this block here

const SocialPlaceholder = (
<li className="wp-block-social-links__social-placeholder">
<div className="wp-block-social-links__social-placeholder-icons">
<div className="wp-social-link wp-social-link-twitter"></div>
<div className="wp-social-link wp-social-link-facebook"></div>
<div className="wp-social-link wp-social-link-instagram"></div>
</div>
</li>
);

it looks unchanged.

It looks unchanged, but I see that still, styles are working fine (background colors, icon colors and padding).

Screenshot 2024-10-16 at 11 57 11

@colinduwe
Copy link
Contributor Author

In your screenshot you've placed 3 real social link blocks inside the social links block so the placeholder isn't shown.

Here's an empty social links block with the pill shape and a background color selected (and the social links block deselected so you can see the placeholder):
Screenshot 2024-10-16 at 8 48 40 AM

@colinduwe
Copy link
Contributor Author

To clarify, in all my screenshots at the start of the discussions I've shown 2 social links blocks, one above the other, both configured with the same style settings. The top social links block in each screenshot is empty. The bottom social links block in that same screenshot is configured with 3 social link blocks (twitter, fb, insta).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Social Affects the Social Block - used to display Social Media accounts First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants