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.

278 lines
8.7 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // Navbar
  2. //
  3. // Provide a static navbar from which we expand to create full-width, fixed, and
  4. // other navbar variations.
  5. .navbar {
  6. // scss-docs-start navbar-css-vars
  7. --#{$prefix}navbar-padding-x: #{if($navbar-padding-x == null, 0, $navbar-padding-x)};
  8. --#{$prefix}navbar-padding-y: #{$navbar-padding-y};
  9. --#{$prefix}navbar-color: #{$navbar-light-color};
  10. --#{$prefix}navbar-hover-color: #{$navbar-light-hover-color};
  11. --#{$prefix}navbar-disabled-color: #{$navbar-light-disabled-color};
  12. --#{$prefix}navbar-active-color: #{$navbar-light-active-color};
  13. --#{$prefix}navbar-brand-padding-y: #{$navbar-brand-padding-y};
  14. --#{$prefix}navbar-brand-margin-end: #{$navbar-brand-margin-end};
  15. --#{$prefix}navbar-brand-font-size: #{$navbar-brand-font-size};
  16. --#{$prefix}navbar-brand-color: #{$navbar-light-brand-color};
  17. --#{$prefix}navbar-brand-hover-color: #{$navbar-light-brand-hover-color};
  18. --#{$prefix}navbar-nav-link-padding-x: #{$navbar-nav-link-padding-x};
  19. --#{$prefix}navbar-toggler-padding-y: #{$navbar-toggler-padding-y};
  20. --#{$prefix}navbar-toggler-padding-x: #{$navbar-toggler-padding-x};
  21. --#{$prefix}navbar-toggler-font-size: #{$navbar-toggler-font-size};
  22. --#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-light-toggler-icon-bg)};
  23. --#{$prefix}navbar-toggler-border-color: #{$navbar-light-toggler-border-color};
  24. --#{$prefix}navbar-toggler-border-radius: #{$navbar-toggler-border-radius};
  25. --#{$prefix}navbar-toggler-focus-width: #{$navbar-toggler-focus-width};
  26. --#{$prefix}navbar-toggler-transition: #{$navbar-toggler-transition};
  27. // scss-docs-end navbar-css-vars
  28. position: relative;
  29. display: flex;
  30. flex-wrap: wrap; // allow us to do the line break for collapsing content
  31. align-items: center;
  32. justify-content: space-between; // space out brand from logo
  33. padding: var(--#{$prefix}navbar-padding-y) var(--#{$prefix}navbar-padding-x);
  34. @include gradient-bg();
  35. // Because flex properties aren't inherited, we need to redeclare these first
  36. // few properties so that content nested within behave properly.
  37. // The `flex-wrap` property is inherited to simplify the expanded navbars
  38. %container-flex-properties {
  39. display: flex;
  40. flex-wrap: inherit;
  41. align-items: center;
  42. justify-content: space-between;
  43. }
  44. > .container,
  45. > .container-fluid {
  46. @extend %container-flex-properties;
  47. }
  48. @each $breakpoint, $container-max-width in $container-max-widths {
  49. > .container#{breakpoint-infix($breakpoint, $container-max-widths)} {
  50. @extend %container-flex-properties;
  51. }
  52. }
  53. }
  54. // Navbar brand
  55. //
  56. // Used for brand, project, or site names.
  57. .navbar-brand {
  58. padding-top: var(--#{$prefix}navbar-brand-padding-y);
  59. padding-bottom: var(--#{$prefix}navbar-brand-padding-y);
  60. margin-right: var(--#{$prefix}navbar-brand-margin-end);
  61. @include font-size(var(--#{$prefix}navbar-brand-font-size));
  62. color: var(--#{$prefix}navbar-brand-color);
  63. text-decoration: if($link-decoration == none, null, none);
  64. white-space: nowrap;
  65. &:hover,
  66. &:focus {
  67. color: var(--#{$prefix}navbar-brand-hover-color);
  68. text-decoration: if($link-hover-decoration == underline, none, null);
  69. }
  70. }
  71. // Navbar nav
  72. //
  73. // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
  74. .navbar-nav {
  75. // scss-docs-start navbar-nav-css-vars
  76. --#{$prefix}nav-link-padding-x: 0;
  77. --#{$prefix}nav-link-padding-y: #{$nav-link-padding-y};
  78. @include rfs($nav-link-font-size, --#{$prefix}nav-link-font-size);
  79. --#{$prefix}nav-link-font-weight: #{$nav-link-font-weight};
  80. --#{$prefix}nav-link-color: var(--#{$prefix}navbar-color);
  81. --#{$prefix}nav-link-hover-color: var(--#{$prefix}navbar-hover-color);
  82. --#{$prefix}nav-link-disabled-color: var(--#{$prefix}navbar-disabled-color);
  83. // scss-docs-end navbar-nav-css-vars
  84. display: flex;
  85. flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
  86. padding-left: 0;
  87. margin-bottom: 0;
  88. list-style: none;
  89. .show > .nav-link,
  90. .nav-link.active {
  91. color: var(--#{$prefix}navbar-active-color);
  92. }
  93. .dropdown-menu {
  94. position: static;
  95. }
  96. }
  97. // Navbar text
  98. //
  99. //
  100. .navbar-text {
  101. padding-top: $nav-link-padding-y;
  102. padding-bottom: $nav-link-padding-y;
  103. color: var(--#{$prefix}navbar-color);
  104. a,
  105. a:hover,
  106. a:focus {
  107. color: var(--#{$prefix}navbar-active-color);
  108. }
  109. }
  110. // Responsive navbar
  111. //
  112. // Custom styles for responsive collapsing and toggling of navbar contents.
  113. // Powered by the collapse Bootstrap JavaScript plugin.
  114. // When collapsed, prevent the toggleable navbar contents from appearing in
  115. // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
  116. // on the `.navbar` parent.
  117. .navbar-collapse {
  118. flex-basis: 100%;
  119. flex-grow: 1;
  120. // For always expanded or extra full navbars, ensure content aligns itself
  121. // properly vertically. Can be easily overridden with flex utilities.
  122. align-items: center;
  123. }
  124. // Button for toggling the navbar when in its collapsed state
  125. .navbar-toggler {
  126. padding: var(--#{$prefix}navbar-toggler-padding-y) var(--#{$prefix}navbar-toggler-padding-x);
  127. @include font-size(var(--#{$prefix}navbar-toggler-font-size));
  128. line-height: 1;
  129. color: var(--#{$prefix}navbar-color);
  130. background-color: transparent; // remove default button style
  131. border: var(--#{$prefix}border-width) solid var(--#{$prefix}navbar-toggler-border-color); // remove default button style
  132. @include border-radius(var(--#{$prefix}navbar-toggler-border-radius));
  133. @include transition(var(--#{$prefix}navbar-toggler-transition));
  134. &:hover {
  135. text-decoration: none;
  136. }
  137. &:focus {
  138. text-decoration: none;
  139. outline: 0;
  140. box-shadow: 0 0 0 var(--#{$prefix}navbar-toggler-focus-width);
  141. }
  142. }
  143. // Keep as a separate element so folks can easily override it with another icon
  144. // or image file as needed.
  145. .navbar-toggler-icon {
  146. display: inline-block;
  147. width: 1.5em;
  148. height: 1.5em;
  149. vertical-align: middle;
  150. background-image: var(--#{$prefix}navbar-toggler-icon-bg);
  151. background-repeat: no-repeat;
  152. background-position: center;
  153. background-size: 100%;
  154. }
  155. .navbar-nav-scroll {
  156. max-height: var(--#{$prefix}scroll-height, 75vh);
  157. overflow-y: auto;
  158. }
  159. // scss-docs-start navbar-expand-loop
  160. // Generate series of `.navbar-expand-*` responsive classes for configuring
  161. // where your navbar collapses.
  162. .navbar-expand {
  163. @each $breakpoint in map-keys($grid-breakpoints) {
  164. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  165. $infix: breakpoint-infix($next, $grid-breakpoints);
  166. // stylelint-disable-next-line scss/selector-no-union-class-name
  167. &#{$infix} {
  168. @include media-breakpoint-up($next) {
  169. flex-wrap: nowrap;
  170. justify-content: flex-start;
  171. .navbar-nav {
  172. flex-direction: row;
  173. .dropdown-menu {
  174. position: absolute;
  175. }
  176. .nav-link {
  177. padding-right: var(--#{$prefix}navbar-nav-link-padding-x);
  178. padding-left: var(--#{$prefix}navbar-nav-link-padding-x);
  179. }
  180. }
  181. .navbar-nav-scroll {
  182. overflow: visible;
  183. }
  184. .navbar-collapse {
  185. display: flex !important; // stylelint-disable-line declaration-no-important
  186. flex-basis: auto;
  187. }
  188. .navbar-toggler {
  189. display: none;
  190. }
  191. .offcanvas {
  192. // stylelint-disable declaration-no-important
  193. position: static;
  194. z-index: auto;
  195. flex-grow: 1;
  196. width: auto !important;
  197. height: auto !important;
  198. visibility: visible !important;
  199. background-color: transparent !important;
  200. border: 0 !important;
  201. transform: none !important;
  202. @include box-shadow(none);
  203. @include transition(none);
  204. // stylelint-enable declaration-no-important
  205. .offcanvas-header {
  206. display: none;
  207. }
  208. .offcanvas-body {
  209. display: flex;
  210. flex-grow: 0;
  211. padding: 0;
  212. overflow-y: visible;
  213. }
  214. }
  215. }
  216. }
  217. }
  218. }
  219. // scss-docs-end navbar-expand-loop
  220. // Navbar themes
  221. //
  222. // Styles for switching between navbars with light or dark background.
  223. .navbar-light {
  224. @include deprecate("`.navbar-light`", "v5.2.0", "v6.0.0", true);
  225. }
  226. .navbar-dark {
  227. // scss-docs-start navbar-dark-css-vars
  228. --#{$prefix}navbar-color: #{$navbar-dark-color};
  229. --#{$prefix}navbar-hover-color: #{$navbar-dark-hover-color};
  230. --#{$prefix}navbar-disabled-color: #{$navbar-dark-disabled-color};
  231. --#{$prefix}navbar-active-color: #{$navbar-dark-active-color};
  232. --#{$prefix}navbar-brand-color: #{$navbar-dark-brand-color};
  233. --#{$prefix}navbar-brand-hover-color: #{$navbar-dark-brand-hover-color};
  234. --#{$prefix}navbar-toggler-border-color: #{$navbar-dark-toggler-border-color};
  235. --#{$prefix}navbar-toggler-icon-bg: #{escape-svg($navbar-dark-toggler-icon-bg)};
  236. // scss-docs-end navbar-dark-css-vars
  237. }