-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation: Explore default frontend styles (#18094)
* try basic version of varia theme styles as default * Add class to show submenu indicator * adjustments for small viewports
- Loading branch information
1 parent
f9b1532
commit db44eff
Showing
2 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters