Commit f3db54f387e for woocommerce
commit f3db54f387eb0252edd16ce533e99a19635d865a
Author: Tung Du <dinhtungdu@gmail.com>
Date: Tue Dec 1 13:24:16 2026 +0700
Purple: use the Button style for the Product Filters button in product grid patterns (#71480)
* Purple: show the theme button for Product Filters in the product grid patterns
Refs WOOPLUG-7823, #69084.
Amp-Thread-ID: https://ampcode.com/threads/T-bae64071-6d1b-4ec7-bb55-ff3f2cceda3a
Amp-Thread-ID: https://ampcode.com/threads/T-23679a20-4e37-4067-9c5b-b831a56c5490
Co-authored-by: Amp <amp@ampcode.com>
* Purple: give Product Filters buttons the outline look
Style the block's buttons in theme.json so the Filter products button
matches Purple's outline buttons.
Amp-Thread-ID: https://ampcode.com/threads/T-23679a20-4e37-4067-9c5b-b831a56c5490
Co-authored-by: Amp <amp@ampcode.com>
---------
Co-authored-by: Amp <amp@ampcode.com>
diff --git a/themes/purple/changelog/69084-product-filters-theme-button b/themes/purple/changelog/69084-product-filters-theme-button
new file mode 100644
index 00000000000..c372985a32b
--- /dev/null
+++ b/themes/purple/changelog/69084-product-filters-theme-button
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+
+Show the Product Filters "Filter products" button as an outline button in the product grid patterns.
diff --git a/themes/purple/patterns/page-new-arrivals.php b/themes/purple/patterns/page-new-arrivals.php
index c8560f2a371..8023d8edd65 100644
--- a/themes/purple/patterns/page-new-arrivals.php
+++ b/themes/purple/patterns/page-new-arrivals.php
@@ -31,7 +31,7 @@
// TODO: Remove the Product Filters spacing override in theme.json once WooCommerce
// PR #67870 ships: https://github.com/woocommerce/woocommerce/pull/67870.
?>
-<!-- wp:woocommerce/product-filters {"style":{"position":{"type":"sticky","top":"var(--wp--preset--spacing--10)"}}} -->
+<!-- wp:woocommerce/product-filters {"overlayButtonStyle":"button","style":{"position":{"type":"sticky","top":"var(--wp--preset--spacing--10)"}}} -->
<div class="wp-block-woocommerce-product-filters wc-block-product-filters"><!-- wp:woocommerce/product-filter-price -->
<div class="wp-block-woocommerce-product-filter-price"><!-- wp:accordion {"style":{"spacing":{"blockGap":"0"}}} -->
<div role="group" class="wp-block-accordion"><!-- wp:accordion-item {"style":{"border":{"bottom":{"color":"var:preset|color|theme-6","width":"1px"},"top":[],"right":[],"left":[]},"spacing":{"margin":{"top":"0","bottom":"0"}}}} -->
diff --git a/themes/purple/patterns/product-grid-with-filters.php b/themes/purple/patterns/product-grid-with-filters.php
index fe5570abbdc..8b241aa4cc0 100644
--- a/themes/purple/patterns/product-grid-with-filters.php
+++ b/themes/purple/patterns/product-grid-with-filters.php
@@ -25,7 +25,7 @@
// TODO: Remove the Product Filters spacing override in theme.json once WooCommerce
// PR #67870 ships: https://github.com/woocommerce/woocommerce/pull/67870.
?>
-<!-- wp:woocommerce/product-filters {"style":{"position":{"type":"sticky","top":"var(--wp--preset--spacing--10)"}}} -->
+<!-- wp:woocommerce/product-filters {"overlayButtonStyle":"button","style":{"position":{"type":"sticky","top":"var(--wp--preset--spacing--10)"}}} -->
<div class="wp-block-woocommerce-product-filters wc-block-product-filters"><!-- wp:woocommerce/product-filter-price -->
<div class="wp-block-woocommerce-product-filter-price"><!-- wp:accordion {"style":{"spacing":{"blockGap":"0"},"@mobile":{"spacing":{"margin":{"top":"var:preset|spacing|30"}}},"@tablet":{"spacing":{"margin":{"top":"var:preset|spacing|30"}}}}} -->
<div role="group" class="wp-block-accordion"><!-- wp:accordion-item {"style":{"border":{"bottom":{"color":"var:preset|color|theme-6","width":"1px"},"top":[],"right":[],"left":[]},"spacing":{"margin":{"top":"0","bottom":"0"}}}} -->
diff --git a/themes/purple/theme.json b/themes/purple/theme.json
index fb23ece368a..8d0e1828341 100644
--- a/themes/purple/theme.json
+++ b/themes/purple/theme.json
@@ -539,7 +539,33 @@
}
},
"woocommerce/product-filters": {
- "css": "--wc-product-filter-block-spacing: 0;"
+ "css": "--wc-product-filter-block-spacing: 0;",
+ "elements": {
+ "button": {
+ "color": {
+ "background": "transparent",
+ "text": "var(--wp--custom--outline-button-color)"
+ },
+ "border": {
+ "color": "currentColor",
+ "width": "1px",
+ "style": "solid"
+ },
+ "spacing": {
+ "padding": {
+ "top": "calc(0.75rem - 1px)",
+ "bottom": "calc(0.75rem - 1px)",
+ "left": "calc(1.25rem - 1px)",
+ "right": "calc(1.25rem - 1px)"
+ }
+ },
+ ":hover": {
+ "color": {
+ "background": "color-mix(in srgb, currentColor 5%, transparent)"
+ }
+ }
+ }
+ }
},
"woocommerce/product-gallery": {
"spacing": {