gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Image and post featured image are missing border style control

Open carolinan opened this issue 3 years ago • 5 comments

Description

The image and featured image block has block support for border color, radius and width. The missing border style control causes problems for themes that has a border style that is more specific than the CSS that is output by the block library:

html :where([style*=border-width]) {
    border-style: solid;
}

This can cause the border to not be visible.

Step-by-step reproduction instructions

Using WordPress 6.2 alpha and https://core.trac.wordpress.org/ticket/56487, Activate Twenty Twenty or Twenty Twenty-One.

  1. Create a new post and add a featured image block.
  2. Add a border color, width and radius,
  3. Confirm that the style looks correct in the editor.
  4. Now please save and view the image on the front.
  5. Confirm that the border is not visible.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.2 Alpha

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

carolinan avatar Jan 25 '23 06:01 carolinan

Before I work on this, I am trying to understand why the border style was omitted. @aaronrobertshaw -I have read through https://github.com/WordPress/gutenberg/pull/42847 but it is still unclear to me: Does the placeholder border break if the border style option is added?

carolinan avatar Jan 25 '23 07:01 carolinan

Thanks for the ping @carolinan 👍

You might find extra context and history in the PR adding border support to the Image block. The supports adopted for the Post Featured Image block were chosen so they were consistent.

I'm currently at the end of my day here and will be AFK tomorrow. I'll dig a little deeper into the history and possible options on Friday.

Edit: Here's where the decision to omit border style was initially made - https://github.com/WordPress/gutenberg/pull/31366#issuecomment-907075652. Perhaps with recent advancements to the block selectors API we might be nearing a time to revisit that call.

aaronrobertshaw avatar Jan 25 '23 08:01 aaronrobertshaw

Hi, This issue has gone 180 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.

github-actions[bot] avatar Jul 25 '23 00:07 github-actions[bot]

Featured Image got border style support in #83956, so only the Image block is left here. It isn't in the remaining border work in #43241. @aaronrobertshaw, was leaving it out of Image a deliberate decision, or should it be added? If it's deliberate, this issue could be closed.

dhananjaykuber avatar Nov 12 '26 07:11 dhananjaykuber

Thanks for the nudge @dhananjaykuber 👍

It wasn't meant to be permanent. Border style was only left off Image "initially" when border support was first added.

Image now sends its border to the img, crop area and placeholder through block selectors. Featured Image had the same setup when it gained border style in #83956.

The two image blocks should match, so I've opened #86733 to add border style to Image, building on #69401. It will close this issue.

aaronrobertshaw avatar Nov 12 '26 10:11 aaronrobertshaw