diff --git a/assets/css/style.scss b/assets/css/style.scss index 7d72d79a03e..d4469472901 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -49,7 +49,8 @@ .wp-block-button__link { word-break: break-word; white-space: normal; - margin: 0 auto !important; + margin-right: auto !important; + margin-left: auto !important; display: inline-flex; justify-content: center; text-align: center; diff --git a/assets/js/atomic/blocks/product-elements/button/style.scss b/assets/js/atomic/blocks/product-elements/button/style.scss index fa0f8732255..bf931c879b1 100644 --- a/assets/js/atomic/blocks/product-elements/button/style.scss +++ b/assets/js/atomic/blocks/product-elements/button/style.scss @@ -1,7 +1,6 @@ .wp-block-button.wc-block-components-product-button { word-break: break-word; white-space: normal; - margin-top: 0; margin-bottom: $gap-small; .wc-block-components-product-button__button { @@ -10,7 +9,8 @@ font-family: inherit; font-weight: inherit; justify-content: center; - margin: 0 auto; + margin-right: auto; + margin-left: auto; white-space: normal; word-break: break-word; } diff --git a/assets/js/atomic/blocks/product-elements/button/supports.ts b/assets/js/atomic/blocks/product-elements/button/supports.ts index 6e5ade74b73..df0be2fb742 100644 --- a/assets/js/atomic/blocks/product-elements/button/supports.ts +++ b/assets/js/atomic/blocks/product-elements/button/supports.ts @@ -22,6 +22,7 @@ export const supports = { }, ...( hasSpacingStyleSupport() && { spacing: { + margin: true, padding: true, __experimentalSkipSerialization: true, }, diff --git a/assets/js/blocks/product-query/constants.ts b/assets/js/blocks/product-query/constants.ts index db842cb4454..dc5b73a7cea 100644 --- a/assets/js/blocks/product-query/constants.ts +++ b/assets/js/blocks/product-query/constants.ts @@ -99,6 +99,15 @@ export const INNER_BLOCKS_TEMPLATE: InnerBlockTemplate[] = [ ], ], ], - [ 'core/query-pagination' ], + [ + 'core/query-pagination', + { + layout: { + type: 'flex', + justifyContent: 'center', + }, + }, + [], + ], [ 'core/query-no-results' ], ]; diff --git a/patterns/product-query-1-1-image-4-column-products-row.php b/patterns/product-query-1-1-image-4-column-products-row.php new file mode 100644 index 00000000000..d8742e50a14 --- /dev/null +++ b/patterns/product-query-1-1-image-4-column-products-row.php @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-3-column-product-row.php b/patterns/product-query-3-column-product-row.php new file mode 100644 index 00000000000..54a80f098eb --- /dev/null +++ b/patterns/product-query-3-column-product-row.php @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-4-column-product-row.php b/patterns/product-query-4-column-product-row.php new file mode 100644 index 00000000000..e363b577415 --- /dev/null +++ b/patterns/product-query-4-column-product-row.php @@ -0,0 +1,37 @@ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-large-image-product-gallery.php b/patterns/product-query-large-image-product-gallery.php new file mode 100644 index 00000000000..5864e0efee1 --- /dev/null +++ b/patterns/product-query-large-image-product-gallery.php @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-minimal-5-column-products-row.php b/patterns/product-query-minimal-5-column-products-row.php new file mode 100644 index 00000000000..7b6eea53265 --- /dev/null +++ b/patterns/product-query-minimal-5-column-products-row.php @@ -0,0 +1,37 @@ + + +
+ + + +
+
+ + + +
+
+ + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-minimal-product-list.php b/patterns/product-query-minimal-product-list.php new file mode 100644 index 00000000000..99f6a061742 --- /dev/null +++ b/patterns/product-query-minimal-product-list.php @@ -0,0 +1,39 @@ + + +
+ +
+
+ + + +
+ + + +
+
+ + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-product-gallery.php b/patterns/product-query-product-gallery.php new file mode 100644 index 00000000000..5610d046ab5 --- /dev/null +++ b/patterns/product-query-product-gallery.php @@ -0,0 +1,35 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-product-list-with-1-1-images.php b/patterns/product-query-product-list-with-1-1-images.php new file mode 100644 index 00000000000..140123d4a62 --- /dev/null +++ b/patterns/product-query-product-list-with-1-1-images.php @@ -0,0 +1,43 @@ + + +
+ +
+
+ + + +
+ + + + + + + +
+
+ + + + + + + + + + + + + +

+ +
+ diff --git a/patterns/product-query-product-list-with-full-product-description.php b/patterns/product-query-product-list-with-full-product-description.php new file mode 100644 index 00000000000..578d99b0127 --- /dev/null +++ b/patterns/product-query-product-list-with-full-product-description.php @@ -0,0 +1,65 @@ + + +
+ +
+
+ + + +
+ + + + + + + + + + +
+
+ + + +
+
+
+
+ + + + +
+
+

+
+ + + +
+
+ + + + + + + + + + + + +

+ +
+ diff --git a/src/BlockTypes/ProductButton.php b/src/BlockTypes/ProductButton.php index 96842f78697..495ef21ab47 100644 --- a/src/BlockTypes/ProductButton.php +++ b/src/BlockTypes/ProductButton.php @@ -88,7 +88,7 @@ protected function render( $attributes, $content, $block ) { if ( $product ) { $cart_redirect_after_add = get_option( 'woocommerce_cart_redirect_after_add' ) === 'yes'; $html_element = ( ! $product->has_options() && $product->is_purchasable() && $product->is_in_stock() && ! $cart_redirect_after_add ) ? 'button' : 'a'; - $styles_and_classes = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes, array( 'border_radius', 'font_size', 'font_weight', 'padding', 'text_color' ) ); + $styles_and_classes = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes, array( 'border_radius', 'font_size', 'font_weight', 'margin', 'padding', 'text_color' ) ); $text_align_styles_and_classes = StyleAttributesUtils::get_text_align_class_and_style( $attributes ); return apply_filters(