Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Independent Publisher 3: New Blockbase Child #4940

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 6 additions & 2 deletions blockbase/assets/ponyfill.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion blockbase/inc/social-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ function get_social_menu_as_social_links_block( $block ) {
if( ! empty( $block['attrs']['itemsJustification'] ) ) {
$class_name .= ' items-justified-' . $block['attrs']['itemsJustification'];
}
$social_links_content = '<!-- wp:social-links {"iconColor":"primary","iconColorValue":"var(--wp--custom--color--primary)","className":"' . $class_name . '"} --><ul class="wp-block-social-links has-icon-color ' . $class_name . '">';

// Get color for social icons.
$theme_data = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_raw_data();
$social_links_icon_color_value = "var(--wp--custom--color--primary)";
$social_links_icon_color = 'primary';
if ( array_key_exists( 'styles', $theme_data ) && array_key_exists( 'blocks', $theme_data['styles'] ) && array_key_exists( 'core/social-links', $theme_data['styles']['blocks'] ) && array_key_exists( 'color', $theme_data['styles']['blocks']['core/social-links'] ) && array_key_exists( 'text', $theme_data['styles']['blocks']['core/social-links']['color'] ) ) {
$social_links_icon_color_value = $theme_data['styles']['blocks']['core/social-links']['color']['text'];
$social_links_icon_color = preg_replace( '/var\(--wp--custom--color--(.+)\)/', '$0 --> $2 $1', $social_links_icon_color_value );
}

$social_links_content = '<!-- wp:social-links {"iconColor":"' . $social_links_icon_color . '","iconColorValue":"' . $social_links_icon_color_value . '","className":"' . $class_name . '"} --><ul class="wp-block-social-links has-icon-color ' . $class_name . '">';
$menu = wp_get_nav_menu_items( $social_menu_id );
foreach ($menu as $menu_item) {
$service_name = preg_replace( '/(-[0-9]+)/', '', $menu_item->post_name );
Expand Down
2 changes: 1 addition & 1 deletion blockbase/rebuild-child-themes.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

declare -a ChildThemes=( "geologist" "mayland-blocks" "payton" "quadrat" "russell" "seedlet-blocks" "skatepark" "videomaker" "zoologist" )
declare -a ChildThemes=( "geologist" "independent-publisher-3", "mayland-blocks" "payton" "quadrat" "russell" "seedlet-blocks" "skatepark" "videomaker" "zoologist" )

for child in ${ChildThemes[@]}; do
cd '../'${child}
Expand Down
8 changes: 6 additions & 2 deletions blockbase/sass/blocks/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
.wp-block-navigation {
// See https://github.com/WordPress/gutenberg/issues/34648
.has-child .wp-block-navigation__submenu-container {
background-color: var(--wp--custom--color--background);
border: var(--wp--custom--form--border--width) var(--wp--custom--form--border--style) var(--wp--preset--color--primary);
background-color: var(--wp--custom--navigation--submenu--color--background);
border: var(--wp--custom--navigation--submenu--border--width) var(--wp--custom--navigation--submenu--border--style) var(--wp--custom--navigation--submenu--border--color);

a {
color: var(--wp--custom--navigation--submenu--color--text);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not defined in theme.json

}
}
&.is-responsive {
&:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
Expand Down
13 changes: 13 additions & 0 deletions blockbase/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,19 @@
"horizontal": "min(30px, 5vw)",
"vertical": "min(30px, 5vw)"
},
"navigation": {
"submenu": {
"border": {
"color": "var(--wp--preset--color--primary)",
"radius": "var(--wp--custom--form--border--radius)",
"style": "var(--wp--custom--form--border--style)",
"width": "var(--wp--custom--form--border--width)"
},
"color": {
"background": "var(--wp--custom--color--background)"
}
}
},
"paragraph": {
"dropcap": {
"margin": ".1em .1em 0 0",
Expand Down
18 changes: 18 additions & 0 deletions independent-publisher-3/assets/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.wp-block-social-links.is-style-logos-only .wp-social-link svg {
width: 1em;
height: 1em;
}

.wp-block-site-title a:hover {
text-decoration: none;
}

h1 a:hover,
h2 a:hover,
h3 a:hover,
h4 a:hover,
h5 a:hover,
h6 a:hover {
color: var(--wp--custom--color--foreground);
text-decoration: none;
}
7 changes: 7 additions & 0 deletions independent-publisher-3/block-template-parts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- wp:group {"style":{"spacing":{"padding":{"bottom":"40px","top":"40px"}}}} -->
<div class="wp-block-group" style="padding-bottom:40px;padding-top:40px;">
<!-- wp:paragraph {"align":"center","style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} -->
<p class="has-text-align-center" style="font-size:var(--wp--custom--font-sizes--tiny);">Proudly Powered by <a href="https://wordpress.org" rel="nofollow">WordPress</a></p>
<!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
15 changes: 15 additions & 0 deletions independent-publisher-3/block-template-parts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- wp:group {"style":{"spacing":{"padding":{"top":"47px","bottom":"58px"}}}} -->
<div class="wp-block-group" style="padding-top:47px;padding-bottom:58px">
<!-- wp:site-logo {"align":"center","className":"is-style-rounded","width":80} /-->
<!-- wp:site-title {"textAlign":"center"} /-->
<!-- wp:site-tagline {"textAlign":"center","style":{"spacing":{"margin":{"top":"5px"}}}} /-->
<!-- wp:spacer {"height":1} -->
<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:navigation {"itemsJustification":"center","overlayMenu":"never","__unstableSocialLinks":"social"} /-->
<!-- wp:spacer {"height":1} -->
<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:navigation {"className":"is-style-blockbase-navigation-improved-responsive","itemsJustification":"center","overlayMenu":"mobile","__unstableLocation":"primary"} /-->
</div>
<!-- /wp:group -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- wp:group {"className":"post-meta","layout":{"type":"flex"},"style":{"typography":{"fontFamily":"var(--wp--preset--font-family--system-font)"}}} -->
<div class="wp-block-group post-meta">
<!-- wp:post-author {"showAvatar":false,"showBio":false,"style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}},"className":"is-style-post-author-icon"} /-->
<!-- wp:post-terms {"term":"category","style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}},"className":"is-style-post-category-icon"} /-->
<!-- wp:post-terms {"term": "post_tag","style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}},"className":"is-style-post-tag-icon"} /-->
<!-- wp:post-date {"isLink":true,"style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}},"className":"is-style-post-date-icon"} /-->
</div>
<!-- /wp:group -->
8 changes: 8 additions & 0 deletions independent-publisher-3/block-template-parts/post-meta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- wp:group {"className":"post-meta","layout":{"type":"flex"}} -->
<div class="wp-block-group post-meta">
<!-- wp:post-author {"showAvatar":false,"showBio":false,"style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} /-->
<!-- wp:post-date {"isLink":true,"style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} /-->
<!-- wp:post-terms {"term":"category","style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} /-->
<!-- wp:post-terms {"term": "post_tag","style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} /-->
</div>
<!-- /wp:group -->
1 change: 1 addition & 0 deletions independent-publisher-3/block-templates/blank.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:post-content {"layout":{"inherit":true}} /-->
10 changes: 10 additions & 0 deletions independent-publisher-3/block-templates/header-footer-only.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">

<!-- wp:post-content {"layout":{"inherit":true}} /-->
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
36 changes: 36 additions & 0 deletions independent-publisher-3/block-templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:query {"tagName":"main","layout":{"inherit":true}} -->
<main class="wp-block-query">
<!-- wp:query-title {"type":"archive","style":{"spacing":{"margin":{"bottom":"100px"}}}} /-->
<!-- wp:post-template -->
<!-- wp:group -->
<div class="wp-block-group">
<!-- wp:post-title {"isLink":true} /-->
<!-- wp:post-featured-image {"isLink":true} /-->
<!-- wp:post-content /-->
<!-- wp:template-part {"slug":"post-meta-icons","layout":{"inherit":true}} /-->
<!-- wp:separator {"color":"tertiary","className":"is-style-wide"} -->
<hr class="wp-block-separator has-text-color has-background has-tertiary-background-color has-tertiary-color is-style-wide"/>
<!-- /wp:separator -->
<!-- wp:spacer {"height":40} -->
<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
</div>
<!-- /wp:group -->
<!-- /wp:post-template -->
<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:query-pagination -->
<!-- wp:query-pagination-previous /-->

<!-- wp:query-pagination-numbers /-->

<!-- wp:query-pagination-next /-->
<!-- /wp:query-pagination -->
</div>
<!-- /wp:group -->
</main>
<!-- /wp:query -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
22 changes: 22 additions & 0 deletions independent-publisher-3/block-templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-title /-->
</div>
<!-- /wp:group -->

<!-- wp:group {"tagName":"main"} -->
<main class="wp-block-group">
<!-- wp:post-featured-image {"align":"full"} /-->

<!-- wp:post-content {"layout":{"inherit":true}} /-->
</main>
<!-- /wp:group -->

<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
20 changes: 20 additions & 0 deletions independent-publisher-3/block-templates/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"layout":{"inherit":true},"tagName":"main"} -->
<main class="wp-block-group">

<!-- wp:query -->
<div class="wp-block-query">
<!-- wp:post-template -->

<!-- wp:post-title {"level":5,"isLink":true} /-->
<!-- wp:post-excerpt /-->

<!-- /wp:post-template -->
</div>
<!-- /wp:query -->

</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
35 changes: 35 additions & 0 deletions independent-publisher-3/block-templates/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:post-title /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"post-meta-icons","layout":{"inherit":true}} /-->

<!-- wp:spacer {"height":1} -->
<div style="height:1px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<main class="wp-block-group">
<!-- wp:post-featured-image {"align":"full"} /-->

<!-- wp:post-content /-->

<!-- wp:post-author {"showBio":true,"byline":"Published by","className":"is-style-default"} /-->

</main>
<!-- /wp:group -->

<!-- wp:group {"layout":{"inherit":true}} -->
<div class="wp-block-group">
<!-- wp:spacer {"height":60} -->
<div style="height:60px" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->
<!-- wp:post-comments /-->
</div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
Loading