No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_navbar-vertical.scss 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. //
  2. // Vertical navbar
  3. //
  4. // Vertical
  5. //
  6. // Creates a vertically aligned version of the navbar
  7. .navbar-vertical {
  8. box-shadow: $navbar-vertical-box-shadow;
  9. .navbar {
  10. border-width: 0 0 1px 0;
  11. border-style: solid;
  12. }
  13. // Navbar light
  14. .navbar-light {
  15. background-color: $navbar-light-bg;
  16. border-color: $navbar-light-border-color;
  17. }
  18. // Navbar brand
  19. .navbar-brand {
  20. margin-right: 0;
  21. }
  22. .navbar-brand-img,
  23. .navbar-brand > img {
  24. max-width: 100%;
  25. max-height: 2rem;
  26. }
  27. // Navbar collapse
  28. @include media-breakpoint-up(md) {
  29. .navbar-collapse {
  30. margin-left: -$navbar-padding-x;
  31. margin-right: -$navbar-padding-x;
  32. padding-left: $navbar-padding-x;
  33. padding-right: $navbar-padding-x;
  34. &:before {
  35. content: '';
  36. display: block;
  37. margin: $navbar-padding-y (-$navbar-padding-x);
  38. }
  39. }
  40. }
  41. // Navbar navigaton
  42. .navbar-nav {
  43. margin-left: -$navbar-padding-x;
  44. margin-right: -$navbar-padding-x;
  45. // Navbar link
  46. .nav-link {
  47. padding-left: $navbar-padding-x;
  48. padding-right: $navbar-padding-x;
  49. font-size: $navbar-nav-link-font-size;
  50. &.active {
  51. position: relative;
  52. &:before {
  53. content: '';
  54. position: absolute;
  55. left: 0;
  56. top: $nav-link-padding-y;
  57. bottom: $nav-link-padding-y;
  58. border-left: 2px solid $primary;
  59. }
  60. }
  61. // Icon
  62. > i {
  63. min-width: $navbar-icon-min-width;
  64. font-size: .9375rem;
  65. line-height: ($font-size-base * $line-height-base);
  66. }
  67. // Dropdown
  68. .dropdown-menu {
  69. border: none;
  70. .dropdown-menu {
  71. margin-left: $dropdown-item-padding-x / 2;
  72. }
  73. }
  74. }
  75. }
  76. // Navbar navigation
  77. .navbar-nav .nav-link {
  78. display: flex;
  79. align-items: center;
  80. }
  81. .navbar-nav .nav-link[data-toggle="collapse"] {
  82. &:after {
  83. display: inline-block;
  84. font-style: normal;
  85. font-variant: normal;
  86. text-rendering: auto;
  87. -webkit-font-smoothing: antialiased;
  88. font-family: 'Font Awesome 5 Free';
  89. font-weight: 700;
  90. content: "\f105";
  91. margin-left: auto;
  92. color: $text-muted;
  93. transition: $transition-base;
  94. } // Expanded
  95. &[aria-expanded="true"] {
  96. &:after {
  97. transform: rotate(90deg);
  98. }
  99. }
  100. }
  101. // Second level
  102. .navbar-nav .nav .nav-link {
  103. padding-left: $navbar-padding-x + $navbar-icon-min-width;
  104. }
  105. // Third level
  106. .navbar-nav .nav .nav .nav-link {
  107. padding-left: $navbar-padding-x * 1.5 + $navbar-icon-min-width;
  108. }
  109. // Navbar heading
  110. .navbar-heading {
  111. padding-top: $nav-link-padding-y;
  112. padding-bottom: $nav-link-padding-y;
  113. font-size: $font-size-xs;
  114. text-transform: uppercase;
  115. letter-spacing: .04em;
  116. }
  117. // Expanded navbar specific styles
  118. &.navbar-expand {
  119. @each $breakpoint,
  120. $dimension in $grid-breakpoints {
  121. &-#{$breakpoint} {
  122. @include media-breakpoint-up(#{$breakpoint}) {
  123. display: block;
  124. position: fixed;
  125. top: 0;
  126. bottom: 0;
  127. width: 100%;
  128. max-width: $navbar-vertical-width;
  129. padding-left: $navbar-vertical-padding-x;
  130. padding-right: $navbar-vertical-padding-x;
  131. overflow-y: auto;
  132. // Container
  133. >[class*="container"] {
  134. flex-direction: column;
  135. align-items: stretch;
  136. min-height: 100%;
  137. padding-left: 0;
  138. padding-right: 0; // Target IE 10 & 11
  139. @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  140. min-height: none;
  141. height: 100%;
  142. }
  143. }
  144. // Fixes the vertical navbar to the left
  145. &.fixed-left {
  146. left: 0;
  147. border-width: 0 1px 0 0;
  148. }
  149. // Fixed the vertical navbar to the right
  150. &.fixed-right {
  151. right: 0;
  152. border-width: 0 0 0 1px;
  153. }
  154. // Navbar collapse
  155. .navbar-collapse {
  156. flex: 1;
  157. display: flex;
  158. flex-direction: column;
  159. align-items: stretch;
  160. margin-left: -$navbar-vertical-padding-x;
  161. margin-right: -$navbar-vertical-padding-x;
  162. padding-left: $navbar-vertical-padding-x;
  163. padding-right: $navbar-vertical-padding-x;
  164. > * {
  165. min-width: 100%;
  166. }
  167. }
  168. // Navbar navigation
  169. .navbar-nav {
  170. flex-direction: column;
  171. margin-left: -$navbar-vertical-padding-x;
  172. margin-right: -$navbar-vertical-padding-x;
  173. }
  174. .navbar-nav .nav-link {
  175. padding: $navbar-vertical-nav-link-padding-y $navbar-vertical-nav-link-padding-x;
  176. &.active {
  177. &:before {
  178. top: $nav-link-padding-y;
  179. bottom: $nav-link-padding-y;
  180. left: 0;
  181. right: auto;
  182. border-left: 2px solid $primary;
  183. border-bottom: 0;
  184. }
  185. }
  186. }
  187. // Second level
  188. .navbar-nav .nav .nav-link {
  189. padding-left: $navbar-vertical-padding-x + $navbar-icon-min-width;
  190. }
  191. // Third level
  192. .navbar-nav .nav .nav .nav-link {
  193. padding-left: $navbar-vertical-padding-x * 1.5 + $navbar-icon-min-width;
  194. }
  195. // Navbar brand
  196. .navbar-brand {
  197. display: block;
  198. text-align: center;
  199. padding-top: (2rem - $navbar-padding-y);
  200. padding-bottom: (2rem - $navbar-padding-y);
  201. }
  202. .navbar-brand-img {
  203. max-height: 2.5rem;
  204. }
  205. // Navbar user
  206. .navbar-user {
  207. margin-left: -$navbar-vertical-padding-x;
  208. margin-right: -$navbar-vertical-padding-x;
  209. padding-top: $spacer;
  210. padding-bottom: $spacer - $navbar-padding-y;
  211. padding-left: $navbar-vertical-padding-x;
  212. padding-right: $navbar-vertical-padding-x;
  213. border-top: 1px solid $border-color;
  214. // Dropup menu
  215. .dropup .dropdown-menu {
  216. left: 50%;
  217. transform: translateX(-50%);
  218. }
  219. }
  220. }
  221. }
  222. }
  223. }
  224. }