Skip to content

Commit

Permalink
Videomaker: Navigation styles (#4876)
Browse files Browse the repository at this point in the history
* Videomaker: center nav items

* Videomaker: remove uppercase from nav block

* Videomaker: center social links

* Videomaker: add current-menu-item styles

* Videomaker: add underline to parent menu item

* Videomaker: increase nav spacing

* Videomaker: tweak spacing again

* Videomaker: style current menu item

* Videomaker: fix submenu centering

* Videomaker: make all pattern navs uppercase

* Blockbase: Remove ! important rules from navigation CSS

* Always show submenu items

* Remove another ! important

Co-authored-by: Ben Dwyer <[email protected]>
  • Loading branch information
mikachan and scruffian authored Oct 20, 2021
1 parent abfcb36 commit 46f1ed1
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 30 deletions.
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"} /-->
</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

0 comments on commit 46f1ed1

Please sign in to comment.