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

Navigation: Explore default frontend styles #18094

Merged
merged 3 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
107 changes: 107 additions & 0 deletions packages/block-library/src/navigation-menu/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
.wp-block-navigation-menu {

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

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 {
&: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
// TODO: needs to apply to items with children only
& > ul > li > 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