The markup of this demo is nearly identical with the default markup, except for this demo we're using the FontAwesome library for menu icons. There are however a series of customizations and tweaks we would like to talk about.
toggleSiblings: true
option. When expanding a new parent menu
item, the component will collapse any sibling menu item and all its child submenus.i.parent-icon
elements width and height.// navbar-left.scss - mixins
@include navbar-mobile-layout;
@include navbar-desktop-side-layout; // special column navbar layout mixin
@include navbar-style;
@include nav-layout;
@include nav-style;
@include subnav-style;
@include left-side; // special position and animation mixin
navbar-mobile-layout
sets the mobile view of the navbar, just like for the default layout;navbar-desktop-side-layout
sets the special column layout of the navbar for desktop view;navbar-style
applies colors and background colors for the navbar and various;nav-layout
sets the menu layout for all menu tree, no difference here;nav-style
applies the root menu item colors and background colors;subnav-style
applies the submenu background, box-shadow and submenu item colors and background
colors;left-side
this sets the position of submenu and animations accordingly for the LEFT column.// left.html - custom CSS variable values
.navbar {
--n-primary-color: #cd3232;
--n-bg: #544040;
--n-subnav-padding-x: .5rem;
--n-subnav-padding-y: .5rem;
--n-subnav-item-hover-color: #eee;
--n-subnav-item-hover-bg: #4b3939;
--n-item-active-bg: var(--n-primary-color);
--n-subnav-item-active-bg: var(--n-primary-color);
--n-subnav-larger-width: calc(var(--n-subnav-width) * 3 + var(--n-subnav-padding-x) * 2);
}
We've customized the active menu item colors, background-colors and added some spacing to the
.subnav
elements as well as the mega menu width.
Also on the left side you have the Left Menu were we used the menu without the wrapper. Another cool demo is of course the full right navbar, similar to this very page, go ahead and check it out.