Skip to content

Commit

Permalink
use corerect classes to alter flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Vicente Canales authored and jasmussen committed Mar 22, 2021
1 parent 12de19d commit 64f9fad
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 31 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function Navigation( {
setResponsiveMenuOpen( false );
} }
>
Close
X
</Button>
<div id={ `${ clientId }-modal-content` }>
<ul { ...innerBlocksProps }></ul>
Expand Down
6 changes: 6 additions & 0 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,9 @@ $color-control-label-height: 20px;
flex-direction: row-reverse; // This puts the chevron, which is hidden from screen readers, on the right.
}
}

.wp-block-navigation__responsive-container-close {
position: absolute;
top: 170px; // Arbitrary position to display close button below editor tools
right: 16px;
}
64 changes: 35 additions & 29 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,25 @@
margin: 0;
padding-left: 0;
display: none;
@include break-mobile() {
// Horizontal layout
display: flex;
flex-wrap: wrap;

// Vertical layout
.is-vertical & {
display: block;
}
}

}
.wp-block-navigation__responsive-container {
display: none;
opacity: 0;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
transition: all 200ms;
background-color: #fff;
/*
arbitrary, high z-index
Expand All @@ -41,20 +50,40 @@
&.is-open {
display: flex;
flex-direction: column;
opacity: 1;
ul {
.wp-block-navigation__container {
display: flex;
flex-direction: column;
}
}

@include break-mobile() {
display: flex;
flex-direction: row;
position: relative;
background-color: inherit;
&.is-open {
flex-direction: row;
.wp-block-navigation__container {
flex-direction: row;
}
}
}
}
.wp-block-navigation__responsive-container-open {
@include break-mobile {
display: none;
}
}
.wp-block-navigation__responsive-container-close {
position: absolute;
top: 12rem;
right: 3rem;
top: 60px;
right: 16px;
font-size: 1rem;
background-color: #000;
color: #fff;
@include break-mobile() {
display: none;
}
}
// Justification.
.items-justified-center > ul {
Expand All @@ -68,26 +97,3 @@
.items-justified-space-between > ul {
justify-content: space-between;
}
@include break-mobile() {
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
display: none;
}
.wp-block-navigation__responsive-container {
display: flex;
flex-direction: row;
position: relative;
opacity: 1;
background-color: inherit;
}
.wp-block-navigation__container {
// Horizontal layout
display: flex;
flex-wrap: wrap;

// Vertical layout
.is-vertical & {
display: block;
}
}
}
10 changes: 9 additions & 1 deletion packages/block-library/src/page-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,16 @@
}
}

.is-vertical .wp-block-navigation__container {
.is-vertical .wp-block-navigation__container,
.is-open .wp-block-navigation__container {
.wp-block-page-list {
display: block;
}
}
.is-open .wp-block-navigation__container {
.wp-block-page-list {
@include break-mobile() {
display: flex;
}
}
}

0 comments on commit 64f9fad

Please sign in to comment.