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

Videomaker: Navigation styles #4876

Merged
merged 13 commits into from
Oct 20, 2021
16 changes: 8 additions & 8 deletions blockbase/assets/ponyfill.css

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

2 changes: 1 addition & 1 deletion blockbase/block-template-parts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<!-- wp:site-logo /-->
<!-- wp:site-title /-->
<!-- wp:site-tagline {"style":{"typography":{"fontSize":"var(--wp--custom--font-sizes--tiny)"}}} /-->
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary","__unstableSocialLinks":"social"} /-->
<!-- wp:navigation {"className":"is-style-blockbase-navigation-improved-responsive","itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary","__unstableSocialLinks":"social"} /-->
Copy link
Member

Choose a reason for hiding this comment

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

I added this for testing, but I do think it looks better too. What do you think @kjellr ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think this can use the standard block style. 👍

</div>
<!-- /wp:group -->
25 changes: 15 additions & 10 deletions blockbase/sass/blocks/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,28 @@

.wp-block-navigation.is-style-blockbase-navigation-improved-responsive {
&.is-responsive .is-menu-open {
font-size: var(--wp--preset--font-size--medium) !important;
font-size: var(--wp--preset--font-size--medium);

.wp-block-navigation__container {
row-gap: 0.5rem !important;
align-items: flex-start !important;
row-gap: 0.5rem;
align-items: flex-start;
flex: unset;
padding-bottom: 0;
}

.wp-block-navigation-item {
align-items: flex-start !important;
align-items: flex-start;
}
.wp-block-navigation__submenu-container {
font-size: var(--wp--preset--font-size--normal) !important;
padding-bottom: 0;
padding-left: var(--wp--custom--gap--horizontal) !important;
padding-top: 0.5rem;
row-gap: 0.5rem !important;
.wp-block-navigation__responsive-container-content .has-child { // Needed for specificity to beat the navigation block CSS
.wp-block-navigation__submenu-container {
font-size: var(--wp--preset--font-size--normal);
padding-bottom: 0;
padding-left: var(--wp--custom--gap--horizontal);
padding-top: 0.5rem;
row-gap: 0.5rem;
}
}

ul.wp-block-social-links {
justify-content: flex-start;
}
Expand Down
28 changes: 28 additions & 0 deletions videomaker/assets/theme.css

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

5 changes: 0 additions & 5 deletions videomaker/child-theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@
"fontFamily": "var(--wp--preset--font-family--inter)"
}
},
"core/navigation": {
"typography": {
"textTransform": "uppercase"
}
},
"core/navigation-link": {
"color": {
"background": "transparent",
Expand Down
2 changes: 1 addition & 1 deletion videomaker/inc/patterns/background-video.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center">
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary"} /-->
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary","style":{"typography":{"textTransform":"uppercase"}}} /-->
</div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
Expand Down
2 changes: 1 addition & 1 deletion videomaker/inc/patterns/full-width-homepage.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<!-- /wp:column -->

<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary"} /--></div>
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary","style":{"typography":{"textTransform":"uppercase"}}} /--></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h3 style="font-weight:300">' . esc_html__( 'Jonah is Creative Director of Hano, a production studio that specializes in combining storytelling with visual design.', 'videomaker' ) . '</h3>
<!-- /wp:heading -->

<!-- wp:navigation {"orientation":"vertical","__unstableLocation":"primary"} /-->
<!-- wp:navigation {"orientation":"vertical","__unstableLocation":"primary","style":{"typography":{"textTransform":"uppercase"}}} /-->

</div>
<!-- /wp:column -->
Expand Down
36 changes: 35 additions & 1 deletion videomaker/sass/_navigation.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
// Needed until this is merged: https://github.com/WordPress/gutenberg/issues/35040
.is-vertical.items-justified-right ul.wp-block-navigation__container {
align-items: flex-end;
}
}

.wp-block-navigation.is-style-blockbase-navigation-improved-responsive {
&.is-responsive .is-menu-open.wp-block-navigation__responsive-container {
.wp-block-navigation__container {
align-items: center;
row-gap: 1rem;
}

.wp-block-navigation__responsive-container-content { // Needed for specificity to beat the navigation block CSS
.wp-block-navigation-item {
align-items: center;
row-gap: 0.8rem;

&.current-menu-item > a {
text-decoration: underline;
}

&.has-child {
.wp-block-navigation__submenu-container {
padding-left: 0;
padding-right: 0;
}
}
}
}
.wp-block-navigation__responsive-container-content {
justify-content: space-between;
}
ul.wp-block-social-links {
justify-content: center;
padding-bottom: calc( var(--wp--custom--gap--vertical) * 2 );
}
}
}
3 changes: 1 addition & 2 deletions videomaker/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,7 @@
},
"core/navigation": {
"typography": {
"fontSize": "var(--wp--preset--font-size--normal)",
"textTransform": "uppercase"
"fontSize": "var(--wp--preset--font-size--normal)"
}
},
"core/post-title": {
Expand Down