Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Product Button: Transition from using CSS margin to Global Styles #8239

Merged
merged 2 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion assets/js/atomic/blocks/product-elements/button/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.wp-block-button.wc-block-components-product-button {
word-break: break-word;
white-space: normal;
margin-bottom: $gap-small;

.wc-block-components-product-button__button {
border-style: none;
Expand All @@ -20,6 +19,10 @@
min-width: 8em;
min-height: 3em;
}

.wc-block-all-products & {
margin-bottom: $gap-small;
}
}

.is-loading .wc-block-components-product-button > .wc-block-components-product-button__button {
Expand Down
10 changes: 9 additions & 1 deletion assets/js/blocks/product-query/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,15 @@ export const INNER_BLOCKS_TEMPLATE: InnerBlockTemplate[] = [
],
[
'woocommerce/product-button',
{ textAlign: 'center', fontSize: 'small' },
{
textAlign: 'center',
fontSize: 'small',
style: {
spacing: {
margin: { bottom: '1rem' },
},
},
},
[],
],
],
Expand Down
2 changes: 1 addition & 1 deletion patterns/product-query-1-1-image-4-column-products-row.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- wp:woocommerce/product-price {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /-->

<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small"} /-->
<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"textAlign":"center","fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /-->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"center"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/product-query-4-column-product-row.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- wp:woocommerce/product-rating {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /--></div>
<!-- /wp:group -->

<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"top":"1em"}}}} /-->
<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"top":"1em","bottom":"1em"}}}} /-->
<!-- /wp:post-template -->

<!-- wp:query-pagination {"layout":{"type":"flex","justifyContent":"center"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/product-query-product-list-with-1-1-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<!-- wp:woocommerce/product-price {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /-->

<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small"} /--></div>
<!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
<!-- /wp:post-template -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<!-- /wp:column -->

<!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small"} /--></div>
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:woocommerce/product-button {"isDescendentOfQueryLoop":true,"fontSize":"small","style":{"spacing":{"margin":{"bottom":"1rem"}}}} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:column --></div>
Expand Down