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: Update Videomaker navigation #5059

Merged
merged 5 commits into from
Nov 24, 2021
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
1 change: 1 addition & 0 deletions blockbase/sass/blocks/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.wp-block-navigation-item {
align-items: flex-start;
}

.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);
Expand Down
14 changes: 13 additions & 1 deletion videomaker/assets/theme.css

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

2 changes: 1 addition & 1 deletion videomaker/block-template-parts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<!-- wp:site-tagline /-->
</div>
<!-- /wp:group -->
<!-- wp:navigation {"overlayMenu":"always","__unstableLocation":"primary","className":"is-style-blockbase-navigation-improved-responsive","layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right","orientation":"horizontal"}} /-->
<!-- wp:navigation {"overlayMenu":"always","__unstableLocation":"primary","__unstableSocialLinks":"social","className":"is-style-blockbase-navigation-improved-responsive","layout":{"type":"flex","setCascadingProperties":true,"justifyContent":"right","orientation":"horizontal"}} /-->
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this __unstableSocialLinks attribute about?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is how we show a social navigation inside a navigation block. It allows us to hide the social links inside the overlay, while still allowing menus to be updated via the customizer.

</header>
<!-- /wp:group -->
14 changes: 13 additions & 1 deletion videomaker/sass/_navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@

.wp-block-navigation.is-style-blockbase-navigation-improved-responsive {
&.is-responsive .is-menu-open.wp-block-navigation__responsive-container {
font-size: var(--wp--preset--font-size--large);
font-weight: 200;

.wp-block-navigation__container {
row-gap: 1rem;
}

.wp-block-navigation__responsive-container-content { // Needed for specificity to beat the navigation block CSS
align-items: flex-start;
margin: 0 auto;
max-width: 800px; // This should match the content width

.wp-block-navigation-item {
row-gap: 0rem;
Expand All @@ -25,10 +30,17 @@
}
}
.wp-block-navigation__responsive-container-content {
justify-content: space-between;
flex-wrap: nowrap;
justify-content: center;
}
ul.wp-block-social-links {
padding-bottom: calc( var(--wp--custom--gap--vertical) * 2 );
}

.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--medium);
}
}
}
}