Skip to content

Commit

Permalink
Navigation: Explore default frontend styles (#18094)
Browse files Browse the repository at this point in the history
* try basic version of varia theme styles as default

* Add class to show submenu indicator

* adjustments for small viewports
  • Loading branch information
frontdevde authored Oct 29, 2019
1 parent 078b024 commit 152cbf1
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
119 changes: 119 additions & 0 deletions packages/block-library/src/navigation-menu/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.wp-block-navigation-menu {

& > ul {
display: block;
list-style: none;
margin: 0;
max-width: none;
padding-left: 0;
position: relative;

@include break-small {
display: flex;
flex-wrap: wrap;
}

ul {
padding-left: 0;
}

li {
position: relative;
z-index: 1;

&:hover,
&:focus-within {
cursor: pointer;
z-index: 99999;
}

// Submenu Display
&:hover > ul,
&:focus-within > ul,
& ul:hover,
& ul:focus {
visibility: visible;
opacity: 1;
display: block;
}
}

& > li {

& > a {
padding-left: 0;

@include break-small {
padding-left: 16px;
}
}

&:first-of-type > a {
padding-left: 0;
}

&:last-of-type > a {
padding-right: 0;
}
}

// Sub-menus Flyout
& > li > ul {
margin: 0;
position: absolute;
background: #fff;
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.2);
left: 0;
top: 100%;
min-width: max-content;
opacity: 0;
transition: all 0.5s ease;
visibility: hidden;

ul {
width: 100%;
}
}
}

// Menu Link
a {
display: block;
padding: 16px;
}

// Sub-menu depth indicators
ul ul {

list-style: none;
margin-left: 0;
// Reset the counter for each UL
counter-reset: nested-list;

li a {

padding-top: 8px;
padding-bottom: 8px;

&::before {
// Increment the dashes
counter-increment: nested-list;
// Insert dashes with spaces in between
content: "\2013\00a0" counters(nested-list, "\2013\00a0", none);
}
}
}

// Top-level sub-menu indicators
& .has-sub-menu > a {

&::after {
content: "\00a0\25BC";
display: inline-block;
font-size: 0.6rem;
height: inherit;
width: inherit;
}
}

}
1 change: 1 addition & 0 deletions packages/block-library/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
@import "./latest-comments/style.scss";
@import "./latest-posts/style.scss";
@import "./media-text/style.scss";
@import "./navigation-menu/style.scss";
@import "./paragraph/style.scss";
@import "./pullquote/style.scss";
@import "./quote/style.scss";
Expand Down

0 comments on commit 152cbf1

Please sign in to comment.