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

Fix: Fine tune search block, and use it in different search results templates. #377

Merged
merged 5 commits into from
Sep 23, 2024
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
2 changes: 1 addition & 1 deletion patterns/hidden-404.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<!-- wp:paragraph -->
<p><?php echo esc_html_x( 'The page you are looking for doesn\'t exist, or it has been moved. Please try searching using the form below.', '404 error message', 'twentytwentyfive' ); ?></p>
<!-- /wp:paragraph -->
<!-- wp:search {"label":"<?php esc_html_e( 'Search', 'twentytwentyfive' ); ?>","showLabel":false,"placeholder":"<?php echo esc_attr_x( 'Type something...', 'input placeholder text', 'twentytwentyfive' ); ?>","buttonText":"<?php echo esc_attr_x( 'Search', 'button label', 'twentytwentyfive' ); ?>","style":{"border":{"radius":"999px"}}} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-search"} /-->
</div>
<!-- /wp:group -->
</div>
Expand Down
2 changes: 1 addition & 1 deletion patterns/hidden-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

?>

<!-- wp:search {"label":"<?php esc_html_e( 'Search', 'twentytwentyfive' ); ?>","showLabel":false,"buttonText":"<?php echo esc_attr_x( 'Search', 'button label', 'twentytwentyfive' ); ?>","style":{"border":{"radius":"50px"}},"fontSize":"medium","borderColor":"opacity-20"} /-->
<!-- wp:search {"label":"<?php esc_html_e( 'Search', 'twentytwentyfive' ); ?>","showLabel":false,"placeholder":"<?php echo esc_attr_x( 'Type something...', 'input placeholder text', 'twentytwentyfive' ); ?>","buttonText":"<?php echo esc_attr_x( 'Search', 'button label', 'twentytwentyfive' ); ?>"} /-->
34 changes: 21 additions & 13 deletions patterns/news-blog-search-results-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,33 @@
<!-- wp:template-part {"slug":"header","area":"header"} /-->

<!-- wp:group {"lock":{"move":false,"remove":false},"metadata":{"name":"Archive title and term description"},"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:spacer {"height":"var:preset|spacing|80"} -->
<div style="height:var(--wp--preset--spacing--80)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<div class="wp-block-group">
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide">
<!-- wp:spacer {"height":"var:preset|spacing|80"} -->
<div style="height:var(--wp--preset--spacing--80)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:query-title {"type":"search"} /-->
<!-- wp:query-title {"type":"search"} /-->

<!-- wp:search {"label":"Search","showLabel":false,"buttonText":"Search","style":{"border":{"radius":"50px"}},"fontSize":"medium","borderColor":"opacity-20"} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-search"} /-->

<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer --></div>
<!-- /wp:group --></div>
<!-- wp:spacer {"height":"var:preset|spacing|40"} -->
<div style="height:var(--wp--preset--spacing--40)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:group {"metadata":{"name":"Posts list"},"layout":{"type":"constrained"}} -->
<div class="wp-block-group"><!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide"><!-- wp:pattern {"slug":"twentytwentyfive/news-blog-query-loop"} /--></div>
<!-- /wp:group --></div>
<div class="wp-block-group">
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide">
<!-- wp:pattern {"slug":"twentytwentyfive/news-blog-query-loop"} /-->
</div>
<!-- /wp:group -->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer-newsletter","area":"footer"} /-->
2 changes: 1 addition & 1 deletion patterns/photo-blog-search-results-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!-- wp:query-title {"type":"search","textAlign":"center","align":"wide"} /-->
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide">
<!-- wp:search {"label":"Search","showLabel":false,"buttonText":"Search","align":"center","style":{"border":{"radius":"50px"}},"fontSize":"medium"} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-search"} /-->
</div>
<!-- /wp:group -->
<!-- wp:pattern {"slug":"twentytwentyfive/photo-blog-posts"} /-->
Expand Down
2 changes: 1 addition & 1 deletion patterns/text-only-blog-search-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
<div class="wp-block-group alignwide">
<!-- wp:query-title {"type":"search","align":"wide","fontSize":"x-large"} /-->
<!-- wp:search {"label":"Search","showLabel":false,"widthUnit":"%","buttonText":"Search","style":{"border":{"radius":"100px"}},"fontSize":"small","borderColor":"opacity-20"} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-search"} /-->
</div>
<!-- /wp:group -->
<!-- wp:spacer {"height":"var:preset|spacing|50"} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:query-title {"type":"search","fontSize":"large"} /-->
<!-- wp:search {"label":"Search","showLabel":false,"buttonText":"Search","style":{"border":{"radius":"50px"}},"fontSize":"small","borderColor":"opacity-20"} /-->
<!-- wp:pattern {"slug":"twentytwentyfive/hidden-search"} /-->
<!-- wp:spacer {"height":"var:preset|spacing|50"} -->
<div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
Expand Down
9 changes: 7 additions & 2 deletions theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@
}
},
"core/search": {
"css": "& .wp-block-search__input{border-radius:3.125rem;padding-left:1.5625rem;padding-right:1.5625rem;}",
"css": "& .wp-block-search__input{border-radius:3.125rem;padding-left:1.5625rem;padding-right:1.5625rem;border-color:var(--wp--preset--color--opacity-20);}",
"typography": {
"fontSize": "var:preset|font-size|medium",
"lineHeight": "1.6"
Expand All @@ -1291,6 +1291,11 @@
"margin": {
"left": "1.125rem"
}
},
":hover" : {
"border": {
"color": "transparent"
}
}
}
}
Expand Down Expand Up @@ -1393,7 +1398,7 @@
"text": "var:preset|color|contrast"
},
"border": {
"color": "var:preset|color|accent-1"
"color": "currentColor"
}
},
"border": {
Expand Down
Loading