Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add header block patterns #74

Merged
merged 17 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ function twentytwentytwo_register_block_patterns() {
'header-title-navigation-social',
'header-logo-navigation-offset-tagline',
'header-stacked',
'header-large-dark'
'header-large-dark',
'header-centered-logo',
'header-centered-logo-in-navigation',
'header-centered-title-navigation-social',
'header-title-and-button'
);

foreach ( $block_patterns as $block_pattern ) {
Expand Down
18 changes: 18 additions & 0 deletions inc/patterns/header-centered-logo-in-navigation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Header with centered Logo in Navigation block pattern
*/
return array(
'title' => __( 'Header with centered Logo in Navigation', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-headers' ),
'blockTypes' => array( 'core/template-part/header' ),
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"center"}} -->
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
kjellr marked this conversation as resolved.
Show resolved Hide resolved

<!-- wp:site-logo {"width":90} /-->

<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation --></div>
<!-- /wp:group -->'
);
26 changes: 26 additions & 0 deletions inc/patterns/header-centered-logo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Header with centered Logo block pattern
*/
return array(
'title' => __( 'Header with centered Logo', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-headers' ),
'blockTypes' => array( 'core/template-part/header' ),
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}}} -->
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:columns {"verticalAlignment":"center"} -->
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--></div>
<!-- /wp:column -->

<!-- wp:column {"width":"64px"} -->
<div class="wp-block-column" style="flex-basis:64px"><!-- wp:site-logo {"width":64} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->'
);
30 changes: 30 additions & 0 deletions inc/patterns/header-centered-title-navigation-social.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Centered title with Navigation and Social Links Header block pattern
*/
return array(
'title' => __( 'Centered title with Navigation and Social Links Header', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-headers' ),
'blockTypes' => array( 'core/template-part/header' ),
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}}} -->
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:columns {"verticalAlignment":"center"} -->
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"left","isResponsive":true} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation --></div>
<!-- /wp:column -->

<!-- wp:column {"width":""} -->
<div class="wp-block-column"><!-- wp:site-title {"textAlign":"center","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"700"}}} /--></div>
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} -->
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"twitter"} /-->

<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div>
<!-- /wp:group -->'
);
16 changes: 16 additions & 0 deletions inc/patterns/header-title-and-button.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* Title and Button Header block pattern
*/
return array(
'title' => __( 'Title and Button Header', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-headers' ),
'blockTypes' => array( 'core/template-part/header' ),
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} -->
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /-->

<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation --></div>
<!-- /wp:group -->'
);