-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Change from using a figure to using a div around the single product image
#37853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…product image. Adjust styles to account for this change
|
@rrennick: For context, whenever you're reviewing this, we had a little discussion in Slack on whether this was a breaking change or not, and we think it's ok provided the template version is bumped, etc. Here's the link for your reading pleasure: https://woocommercecommunity.slack.com/archives/C052LGBQD1T/p1681941407318249. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #37853 +/- ##
========================================
Coverage 51.5% 51.5%
+ Complexity 17283 17281 -2
========================================
Files 430 430
Lines 80037 80030 -7
========================================
+ Hits 41216 41217 +1
+ Misses 38821 38813 -8
|
|
@dkotter Thanks for submitting this. You will have to check the SCSS for remaining 4 default themes for styles for the |
…gle image template
@rrennick This is already accounted for in each of those files (see https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/client/legacy/css/twenty-twenty.scss#L531 for one example). They have separate CSS for the I think we want to leave the existing |
While I see where you are coming from, that isn't consistent with the changes to the Twenty-Twenty-Two/Three CSS. We should definitely be consistent across all the default themes.
WooCommerce adds a warning to both the WooCommerce > Status screen and the Plugins screen when a template is out of date. We do make changes to templates that are not 100% backward compatible. |
I guess I'm not following what isn't consistent here? Happy to make any changes as needed but not exactly sure what you're referring to. In our CSS for Twenty-Twenty-Two/Three, the existing code is: figure.woocommerce-product-gallery__wrapper {
margin: 0;
}I've left the The CSS for all other Twenty themes has these lines: figure {
margin: 0;
padding: 0;
}
.woocommerce-product-gallery__wrapper {
margin: 0;
padding: 0;
}While yes, this isn't the exact same as what is done in Twenty-Twenty-Two/Three, the end result in essence is the same (we target both the |
rrennick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkotter This looks great. Thanks for the help.
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR changes the wrapping container around the single product image from using a
figuretag to using adivtag. This is a change to help with accessibility, particularly for screen readers.In addition to changing the tag, I've adjusted some CSS we have in place that impacts the Twenty Twenty Three and Twenty Twenty Two themes. This CSS was scoped to the
figuretag so I've changed that scope to thedivtag. As an alternative, we could change this to being scoped just based on the class and not the tag itself.I've tested this change on Storefront v4.2.0 as well as Twenty Twenty Three v1.0. I've tested at various breakpoints and as far as I can tell, no styles were impacted as part of this change.
Note: I've marked this as a major change because if any existing themes are styling the
figuretag directly instead of the class, those styles will no longer be applied. Not sure if that counts as a breaking change though.Closes #37603
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:
In my testing, I had two windows open where I loaded a product without the changes in this PR and another window with the same product but after the changes made here. This allowed me to compare these two side-by-side to ensure they matched.
Screenshots
figuretag using Storefrontdivtag using Storefrontfiguretag using Twenty Twenty Threedivtag using Twenty Twenty Three