_navs.scss 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. //
  2. // Component: Nav
  3. //
  4. .nav-pills {
  5. .nav-link {
  6. color: $gray-600;
  7. &:not(.active):hover {
  8. color: theme-color("primary");
  9. }
  10. }
  11. .nav-item {
  12. &.dropdown.show {
  13. .nav-link:hover {
  14. color: $dropdown-link-active-color;
  15. }
  16. }
  17. }
  18. }
  19. // Vertical Tabs
  20. .nav-tabs.flex-column {
  21. border-bottom: 0;
  22. border-right: $nav-tabs-border-width solid $nav-tabs-border-color;
  23. .nav-link {
  24. border-bottom-left-radius: $nav-tabs-border-radius;
  25. border-top-right-radius: 0;
  26. margin-right: -$nav-tabs-border-width;
  27. @include hover-focus () {
  28. border-color: $gray-200 transparent $gray-200 $gray-200;
  29. }
  30. }
  31. .nav-link.active,
  32. .nav-item.show .nav-link {
  33. border-color: $gray-300 transparent $gray-300 $gray-300;
  34. }
  35. &.nav-tabs-right {
  36. border-left: $nav-tabs-border-width solid $nav-tabs-border-color;
  37. border-right: 0;
  38. .nav-link {
  39. border-bottom-left-radius: 0;
  40. border-bottom-right-radius: $nav-tabs-border-radius;
  41. border-top-left-radius: 0;
  42. border-top-right-radius: $nav-tabs-border-radius;
  43. margin-left: -$nav-tabs-border-width;
  44. @include hover-focus () {
  45. border-color: $gray-200 $gray-200 $gray-200 transparent;
  46. }
  47. }
  48. .nav-link.active,
  49. .nav-item.show .nav-link {
  50. border-color: $gray-300 $gray-300 $gray-300 transparent;
  51. }
  52. }
  53. }
  54. .navbar-no-expand {
  55. flex-direction: row;
  56. .nav-link {
  57. padding-left: $navbar-nav-link-padding-x;
  58. padding-right: $navbar-nav-link-padding-x;
  59. }
  60. .dropdown-menu {
  61. position: absolute;
  62. }
  63. }
  64. // Color variants
  65. @each $color, $value in $theme-colors {
  66. @if $color == dark or $color == light {
  67. .navbar-#{$color} {
  68. background-color: $value;
  69. @if $color == dark {
  70. border-color: lighten($dark, 10%);
  71. }
  72. }
  73. }
  74. }
  75. @each $color, $value in $theme-colors {
  76. @if $color != dark and $color != light {
  77. @include navbar-variant($color, $value);
  78. }
  79. }
  80. @each $color, $value in $colors {
  81. @include navbar-variant($color, $value);
  82. }
  83. .navbar-nav-not-expanded {
  84. flex-direction: row;
  85. .dropdown-menu {
  86. position: absolute;
  87. }
  88. .nav-link {
  89. padding-right: $navbar-nav-link-padding-x;
  90. padding-left: $navbar-nav-link-padding-x;
  91. }
  92. }
  93. @include dark-mode () {
  94. .nav-pills .nav-link {
  95. color: $gray-400;
  96. }
  97. .nav-tabs {
  98. border-color: lighten($dark, 15%);
  99. .nav-link:focus,
  100. .nav-link:hover {
  101. border-color: lighten($dark, 15%);
  102. }
  103. .nav-item.show .nav-link,
  104. .nav-link.active {
  105. background-color: $dark;
  106. border-color: lighten($dark, 15%) lighten($dark, 15%) transparent lighten($dark, 15%);
  107. color: $white;
  108. }
  109. &.flex-column {
  110. .nav-item.show .nav-link,
  111. .nav-link {
  112. &.active,
  113. &:focus,
  114. &:hover {
  115. border-color: lighten($dark, 15%) transparent lighten($dark, 15%) lighten($dark, 15%);
  116. }
  117. &:focus,
  118. &:hover {
  119. background-color: lighten($dark, 5%);
  120. }
  121. }
  122. &.nav-tabs-right {
  123. border-color: lighten($dark, 15%);
  124. .nav-link {
  125. &.active,
  126. &:focus,
  127. &:hover {
  128. border-color: lighten($dark, 15%) lighten($dark, 15%) lighten($dark, 15%) transparent;
  129. }
  130. }
  131. }
  132. }
  133. }
  134. // Color variants
  135. @each $color, $value in $theme-colors-alt {
  136. @if $color == dark or $color == light {
  137. .navbar-#{$color} {
  138. background-color: $value;
  139. @if $color == dark {
  140. border-color: lighten($dark, 10%);
  141. }
  142. }
  143. }
  144. }
  145. @each $color, $value in $theme-colors-alt {
  146. @if $color != dark and $color != light {
  147. @include navbar-variant($color, $value);
  148. }
  149. }
  150. @each $color, $value in $colors-alt {
  151. @include navbar-variant($color, $value);
  152. }
  153. }