WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.51k stars 4.2k forks source link

Fix focus style of social icons with no link yet #64972

Open afercia opened 2 months ago

afercia commented 2 months ago

Description

Noticed while testing https://github.com/WordPress/gutenberg/pull/64883

When adding social icons, the focus style and the state of a social icon that hasn't a link set yet are problematic.

Screenshot: The Instagram icon isn't linked yet. Notice the opacity alters the focus style. Instead, the GitHub icon is linked. The focus style is the standard one.

Screenshot 2024-09-02 at 09 38 05

Screenshot: the GitHub icon does have a link set, the Instagram one doesn't:

Screenshot 2024-09-02 at 09 33 25

@WordPress/gutenberg-design please provide a new design where the state is communicated via a meaningful, understandable sahpe.

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

afercia commented 2 months ago

How about using the warning icon and removing any opacity? Roughly:

Screenshot 2024-09-02 at 16 10 49

Maybe a new icon to indicate a missing link would be more meaningful.

t-hamano commented 2 months ago

As for the design, I don't have any good ideas at the moment, but apart from that, is there any need to improve the way screen readers read when no links are set? Unlike other blocks, I think the social icon block is expected to always have links applied.

afercia commented 2 months ago

is there any need to improve the way screen readers read when no links are set?

In the editor: the icon should render even with no link set and an appropriate visual indication and label should clearly communicate the icon misses a link. On the front end: I'd tend to think a social icon with no link should no render at all.

hanneslsm commented 2 months ago

How about using the warning icon and removing any opacity? Roughly:

Interesting idea. The icons block is definitely a special case, but let's not forget we have also blocks that currently use a opacity when they are not rendered in the frontend, like the "Read more" link in a Post Template or "Previous Page" and "Next Page" in the Pagination block.

CleanShot 2024-09-04 at 09 25 44@2x

And then, of course, there are image placeholders without opacity.

I guess what I'm trying to say is that we should look holistically from UX and UI standpoint at that topic "placeholders" / what's displayed on the editor but not frontend.