EnhancementGood First IssueKirigamiblock: featured categoryblock: featured product
描述
Describe the bug
Hi, the woocommerce/featured-product block always uses a single background image size even on small viewports.
To reproduce
Steps to reproduce the behavior:
- Add a featured product block on a page/post
- view said page/post in frontend
- inspect the block element in devtools
- the block uses
background-image: url(...);. Therefore the browser cannot select an appropriately sized image for the current viewport size.
Expected behavior
The block should use an <img> or <picture> element w/ appropriate srcset and sizes attributes.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
WordPress (please complete the following information):
- Core version: 5.8.1
- WooCommerce version: 5.8.0
- WooCommerce Blocks version: bundled w/ woocommerce
Desktop (please complete the following information):
- OS: irrelevant
- Browser irrelevant
- Version irrelevant
Smartphone (please complete the following information):
- Device: irrelevant
- OS: irrelevant
- Browser irrelevant
- Version irrelevant
Additional context
See the core/cover block for an example of how it could be done.