WordPress / wporg-developer

WordPress.org Developer theme
https://developer.wordpress.org/
60 stars 25 forks source link

Enhance hook section UI #387

Open renintw opened 1 year ago

renintw commented 1 year ago

https://developer.wordpress.org/redesign-test/reference/functions/register_post_type/#hooks

  1. The description of a hook looks detached. Let's remove the indentation so it lines up with the code above.

  2. Replace the wrong size anchor link icon with WordPress icon.

Description Updated according to https://github.com/WordPress/wporg-developer/issues/387#issuecomment-1819007572 and https://github.com/WordPress/wporg-developer/issues/387#issuecomment-1819025599

jasmussen commented 1 year ago

Hey thanks for the ping. I'm not sure I understand the question, can you clarify it a little bit?

On a separate note, this anchor link icon looks squished:

Screenshot 2023-11-20 at 13 28 16

Looks like there's an icon height property that isn't working as intended:

Screenshot 2023-11-20 at 13 28 37

In general, WordPress icons should always be exactly 24x24px, never scaled except in a few notable exceptions. Let me know if you prefer I open a separate issue for this.

renintw commented 1 year ago

Ah, yes, sorry for not describing it clearly enough. Not sure if the image below clarifies it, if not, please let me know. (Ref)

image
renintw commented 1 year ago

squished anchor link icon

@jasmussen Seems that the original image was not 24px to begin with and it already looked squished. I've tried to remove the *0.75 from the height that appears on the screenshot you shared, but the icon size didn't change.

*original image (2413)**

image

.

jasmussen commented 1 year ago

Right, thank you for the clarification. Two things going on, it seems:

For the icon, you'r right, but I'm not sure where that icon is from, it looks wrong indeed. Can we use a WordPress icon instead? Screenshot 2023-11-20 at 13 49 08

renintw commented 1 year ago

Could it be a width change that causes the longer word WP_Post_Type to make the line wrap

yeah, it wraps because of the width. I was originally thinking that the text was wrapping too early to the next line, leaving too much empty space on the right. But it seems extending the width to make it a single line looks even stranger. I think it's better to keep it as it is.

And I agree with removing the indentation, it is a good idea. I will do so in the PR for this ticket. Additionally, I'll also replace the correct icon image here, so there's no need to open another ticket for that. I will update the description as well. Thanks!

image