123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390 |
- @mixin navbar-vertical-nav {
- .navbar-collapse {
- flex-direction: column;
- [class^="container"] {
- flex-direction: column;
- align-items: stretch;
- padding: 0;
- }
- .navbar-nav {
- margin-left: 0;
- margin-right: 0;
- .nav-link {
- padding: 0.5rem calc(#{$container-padding-x} / 2);
- justify-content: flex-start;
- }
- }
- .dropdown-menu-columns {
- flex-direction: column;
- }
- .dropdown-menu {
- padding: 0;
- background: transparent;
- position: static;
- color: inherit;
- box-shadow: none;
- border: none;
- min-width: 0;
- margin: 0;
- .dropdown-item {
- min-width: 0;
- display: flex;
- width: auto;
- padding-left: add(calc(#{$container-padding-x} / 2), 1.75rem);
- color: inherit;
- &.disabled {
- color: var(--#{$prefix}gray-300);
- pointer-events: none;
- background-color: transparent;
- }
- &.active,
- &:active {
- background: var(--#{$prefix}navbar-active-bg);
- }
- }
- .dropdown-menu .dropdown-item {
- padding-left: add(calc(#{$container-padding-x} / 2), 3.25rem);
- }
- .dropdown-menu .dropdown-menu .dropdown-item {
- padding-left: add(calc(#{$container-padding-x} / 2), 4.75rem);
- }
- }
- .dropdown-toggle:after {
- margin-left: auto;
- }
- .nav-item.active:after {
- border-bottom-width: 0;
- border-left-width: 3px;
- right: auto;
- top: 0;
- bottom: 0;
- }
- }
- }
- /**
- Navbar
- */
- .navbar {
- --#{$prefix}navbar-bg: var(--#{$prefix}bg-surface);
- --#{$prefix}navbar-border-width: #{$navbar-border-width};
- --#{$prefix}navbar-active-border-color: #{$navbar-active-border-color};
- --#{$prefix}navbar-active-bg: #{$navbar-light-active-bg};
- --#{$prefix}navbar-color: var(--#{$prefix}body-color);
- --#{$prefix}navbar-border-color: #{$navbar-border-color};
- align-items: stretch;
- min-height: $navbar-height;
- box-shadow: inset 0 calc(-1 * var(--#{$prefix}navbar-border-width)) 0 0 var(--#{$prefix}navbar-border-color);
- background: var(--#{$prefix}navbar-bg);
- color: var(--#{$prefix}navbar-color);
- .navbar-collapse & {
- flex-grow: 1;
- }
- &.collapsing {
- min-height: 0;
- }
- .dropdown-menu {
- position: absolute;
- z-index: $zindex-fixed;
- }
- .navbar-nav {
- min-height: subtract($navbar-height, 2 * $navbar-padding-y);
- .nav-link {
- position: relative;
- min-width: 2rem;
- min-height: 2rem;
- justify-content: center;
- border-radius: var(--#{$prefix}border-radius);
- .badge {
- position: absolute;
- top: 0.375rem;
- right: 0.375rem;
- transform: translate(50%, -50%);
- }
- }
- }
- }
- .navbar-nav {
- margin: 0;
- padding: 0;
- }
- .navbar-expand {
- @each $breakpoint in map-keys($grid-breakpoints) {
- $next: breakpoint-next($breakpoint, $grid-breakpoints);
- $infix: breakpoint-infix($next, $grid-breakpoints);
- &#{$infix} {
- @include media-breakpoint-down(breakpoint-next($breakpoint)) {
- @include navbar-vertical-nav;
- }
- @include media-breakpoint-up($next) {
- .navbar-collapse {
- width: auto;
- flex: 1 1 auto;
- }
- .nav-item.active {
- position: relative;
- &:after {
- content: "";
- position: absolute;
- left: 0;
- right: 0;
- bottom: -0.25rem;
- border: 0 var(--#{$prefix}border-style) var(--#{$prefix}navbar-active-border-color);
- border-bottom-width: 2px;
- }
- }
- &.navbar-vertical {
- box-shadow: inset calc(-1 * var(--#{$prefix}navbar-border-width)) 0 0 0 var(--#{$prefix}navbar-border-color);
- &.navbar-right {
- box-shadow: inset calc(1 * var(--#{$prefix}navbar-border-width)) 0 0 0 var(--#{$prefix}navbar-border-color);
- }
- }
- &.navbar-vertical {
- ~ .navbar,
- ~ .page-wrapper {
- margin-left: $sidebar-width;
- }
- }
- &.navbar-vertical.navbar-right {
- ~ .navbar,
- ~ .page-wrapper {
- margin-left: 0;
- margin-right: $sidebar-width;
- }
- }
- }
- }
- }
- }
- /**
- Navbar brand
- */
- .navbar-brand {
- display: inline-flex;
- align-items: center;
- font-weight: $navbar-brand-font-weight;
- margin: 0;
- line-height: 1;
- gap: $spacer-2;
- }
- .navbar-brand-image {
- height: $navbar-brand-image-height;
- width: auto;
- }
- /**
- Navbar toggler
- */
- .navbar-toggler {
- border: 0;
- width: $navbar-brand-image-height;
- height: $navbar-brand-image-height;
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .navbar-toggler-icon {
- height: 2px;
- width: 1.25em;
- background: currentColor;
- border-radius: 10px;
- @include transition(
- top $navbar-toggler-animation-time $navbar-toggler-animation-time,
- bottom $navbar-toggler-animation-time $navbar-toggler-animation-time,
- transform $navbar-toggler-animation-time,
- opacity 0s $navbar-toggler-animation-time
- );
- position: relative;
- &:before,
- &:after {
- content: "";
- display: block;
- height: inherit;
- width: inherit;
- border-radius: inherit;
- background: inherit;
- position: absolute;
- left: 0;
- @include transition(inherit);
- }
- &:before {
- top: -0.45em;
- }
- &:after {
- bottom: -0.45em;
- }
- .navbar-toggler[aria-expanded="true"] & {
- transform: rotate(45deg);
- @include transition(top $transition-time, bottom $transition-time, transform $transition-time $transition-time, opacity 0s $transition-time);
- &:before {
- top: 0;
- transform: rotate(-90deg);
- }
- &:after {
- bottom: 0;
- opacity: 0;
- }
- }
- }
- /**
- Navbar transparent
- */
- .navbar-transparent {
- --#{$prefix}navbar-border-color: transparent !important;
- background: transparent !important;
- }
- /**
- Navbar nav
- */
- .navbar-nav {
- align-items: stretch;
- .nav-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- }
- }
- /**
- Navbar side
- */
- .navbar-side {
- margin: 0;
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: space-around;
- }
- /**
- Navbar vertical
- */
- @if $enable-navbar-vertical {
- .navbar-vertical {
- &.navbar-expand {
- @each $breakpoint in map-keys($grid-breakpoints) {
- $next: breakpoint-next($breakpoint, $grid-breakpoints);
- $infix: breakpoint-infix($next, $grid-breakpoints);
- &#{$infix} {
- @include media-breakpoint-up($next) {
- width: $sidebar-width;
- position: fixed;
- top: 0;
- left: 0;
- bottom: 0;
- z-index: $zindex-fixed;
- align-items: flex-start;
- @include transition(transform $transition-time);
- overflow-y: scroll;
- padding: 0;
- &.navbar-right {
- left: auto;
- right: 0;
- }
- .navbar-brand {
- padding: (($navbar-height - $navbar-brand-image-height) * 0.5) 0;
- justify-content: center;
- }
- .navbar-collapse {
- align-items: stretch;
- }
- .navbar-nav {
- flex-direction: column;
- flex-grow: 1;
- min-height: auto;
- .nav-link {
- padding-top: 0.5rem;
- padding-bottom: 0.5rem;
- }
- }
- > [class^="container"] {
- flex-direction: column;
- align-items: stretch;
- min-height: 100%;
- justify-content: flex-start;
- padding: 0;
- }
- ~ .page {
- padding-left: $sidebar-width;
- [class^="container"] {
- padding-left: 1.5rem;
- padding-right: 1.5rem;
- }
- }
- &.navbar-right ~ .page {
- padding-left: 0;
- padding-right: $sidebar-width;
- }
- @include navbar-vertical-nav;
- }
- }
- }
- }
- }
- }
- .navbar-overlap {
- &:after {
- content: "";
- height: $navbar-overlap-height;
- position: absolute;
- top: 100%;
- left: 0;
- right: 0;
- background: inherit;
- z-index: -1;
- box-shadow: inherit;
- }
- }
|