_navbar.scss 7.3 KB

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