-
Notifications
You must be signed in to change notification settings - Fork 219
Use consistent and semantically correct HTML elements in the Cart and Checkout blocks #9065
Use consistent and semantically correct HTML elements in the Cart and Checkout blocks #9065
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
26a7e0e
to
05bf111
Compare
Size Change: -217 B (0%) Total Size: 1.1 MB
ℹ️ View Unchanged
|
@@ -35,7 +35,6 @@ const OrderSummary = ( { | |||
{ __( 'Order summary', 'woo-gutenberg-products-block' ) } | |||
</span> | |||
} | |||
titleTag="h2" |
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.
The issue description on #8976 states the following:
The title
Order summary
uses a<span>
element instead of an<h2>
element.
Given that this element will contain a few sub elements, I believe using a <div>
is the better option here. Therefore, instead of changing titleTag="h2"
to titleTag="span"
, I removed that part, as div
is defined as the default titleTag.
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.
Thank you for working on it, @nielslange! It works as expected. 🎉
Yeah! Thanks for your review, @tarunvijwani! 🙌 |
…nsistent-semantically-correct-HTML-markup
* Dummy commit to open a PR * Revert the last change * Ensure Checkout block supports the theme-level global styles for `Colors » Buttons` (#8844) * Add GS support for button colors in Checkout block * Sync button hover effect with GB * Fix link margin/padding (#8908) * Replace <AddToCartButton /> with <ProductButton /> (#8914) * Add GS support for button typography in Checkout block (#8918) * Ensure Checkout block supports the theme-level global styles for Typography » Buttons (#8892) * Remove classname from cart image to avoid conflicts (#8898) Co-authored-by: Niels Lange <[email protected]> * Use consistent and semantically correct HTML elements in the Cart and Checkout blocks (#9065) * Allow button height to adjust * Ensure to display full width heading background * Inherit font style and font weight for headings * Inherit font style and font weight for textarea * Inherit font family and font weight for buttons --------- Co-authored-by: Niels Lange <[email protected]> Co-authored-by: Mike Jolley <[email protected]>
🤖 Generated by Copilot at 05bf111
Summary
🚚🧹🎨
This pull request refactors the order summary heading components in the cart and checkout blocks, to improve their accessibility, semantics, and reusability. It removes the
Title
component and thetitleTag
prop, and uses simplespan
elements instead of nested headings.Walkthrough
titleTag
prop fromOrderSummary
component to simplify API and avoid nested headings (link)Title
component withspan
element incart-order-summary-heading
block and edit components to align withOrderSummary
change and reduce bundle size (link, link, link, link, link)👨💼 Enhanced by @nielslange
Fixes #8976
Testing
User Facing Testing
CART TOTALS
element, with the CSS class.wc-block-cart__totals-title
, is using a<span>
instead of an<h2>
.Order summary
element, with the CSS class.wc-block-components-order-summary
, is using a<div>
instead of an<h2>
.CART TOTALS
element, with the CSS class.wc-block-cart__totals-title
, is using a<span>
instead of an<h2>
.Order summary
element, with the CSS class.wc-block-components-order-summary
, is using a<div>
instead of an<h2>
.WooCommerce Visibility