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

[Patterns]: Add new Header Centered Search pattern #9081

Merged
merged 13 commits into from
Apr 27, 2023
3 changes: 3 additions & 0 deletions assets/js/blocks/customer-account/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"typography": {
"fontSize": true,
"__experimentalFontFamily": true
},
"spacing": {
"margin": true
}
},
"attributes": {
Expand Down
54 changes: 54 additions & 0 deletions patterns/header-centered-search-pattern.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* Title: WooCommerce Header Centered Search
* Slug: woocommerce-blocks/header-centered-search
* Categories: WooCommerce
* Block Types: core/template-part/header
*/
?>

<!-- wp:group {"align":"full","layout":{"type":"constrained"}} -->
<div class="wp-block-group alignfull">
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"2%","bottom":"16px","left":"2%","top":"16px"},"margin":{"top":"0px","bottom":"0px"}}},"className":"sticky-header","layout":{"type":"flex","flexWrap":"wrap","justifyContent":"space-between"}} -->
<div class="wp-block-group alignfull sticky-header" style="margin-top:0px;margin-bottom:0px;padding-top:16px;padding-right:2%;padding-bottom:16px;padding-left:2%">
<!-- wp:group {"style":{"spacing":{"blockGap":"40px"}},"layout":{"type":"flex","flexWrap":"wrap"}} -->
<div class="wp-block-group">
<!-- wp:site-logo {"shouldSyncIcon":false} /-->
<!-- wp:site-title /-->
</div>
<!-- /wp:group -->

<!-- wp:group {"style":{"spacing":{"blockGap":"8px"},"typography":{"fontSize":"13px"}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"right"}} -->
<div class="wp-block-group" style="font-size:13px">
<!-- wp:group {"style":{"spacing":{"blockGap":"16px"}},"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group">
<!-- wp:separator {"className":"is-style-wide"} -->
<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" />
<!-- /wp:separator -->
</div>
<!-- /wp:group -->
albarin marked this conversation as resolved.
Show resolved Hide resolved

<!-- wp:search {"label":"Search","showLabel":false,"placeholder":"Search for products or brands","width":350,"widthUnit":"px","buttonText":"Search","buttonPosition":"button-inside","buttonUseIcon":true,"style":{"color":{"background":"#ffffff00"}},"textColor":"foreground"} /-->

<!-- wp:woocommerce/customer-account {"displayStyle":"icon_only","iconClass":"wc-block-customer-account__account-icon","style":{"spacing":{"margin":{"left":"10px"}}}} /-->

<!-- wp:woocommerce/mini-cart {"style":{"typography":{"fontSize":"14px"}}} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:separator {"align":"full","className":"is-style-wide"} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity is-style-wide" />
<!-- /wp:separator -->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"}} -->
<div class="wp-block-group"><!-- wp:navigation /-->
</div>
<!-- /wp:group -->

<!-- wp:separator {"align":"full","className":"is-style-wide"} -->
<hr class="wp-block-separator alignfull has-alpha-channel-opacity is-style-wide" />
<!-- /wp:separator -->
</div>
<!-- /wp:group -->