Image and post featured image are missing border style control
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.
- Create a new post and add a featured image block.
- Add a border color, width and radius,
- Confirm that the style looks correct in the editor.
- Now please save and view the image on the front.
- 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
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?
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.
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.
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.
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.