_navbar.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. @use 'sass:math';
  2. // Contents
  3. //
  4. // Navbar
  5. // Navbar brand
  6. // Navbar nav
  7. // Navbar text
  8. // Responsive navbar
  9. // Navbar position
  10. // Navbar themes
  11. // Navbar
  12. //
  13. // Provide a static navbar from which we expand to create full-width, fixed, and
  14. // other navbar variations.
  15. .navbar {
  16. position: relative;
  17. display: flex;
  18. flex-wrap: wrap; // allow us to do the line break for collapsing content
  19. align-items: center;
  20. justify-content: space-between; // space out brand from logo
  21. padding-top: $navbar-padding-y;
  22. padding-right: $navbar-padding-x; // default: null
  23. padding-bottom: $navbar-padding-y;
  24. padding-left: $navbar-padding-x; // default: null
  25. @include gradient-bg();
  26. margin-top: 1.5rem + $navbar-padding-y;
  27. outline-offset: 0.5rem;
  28. outline: 1px solid $light;
  29. // Because flex properties aren't inherited, we need to redeclare these first
  30. // few properties so that content nested within behave properly.
  31. // The `flex-wrap` property is inherited to simplify the expanded navbars
  32. %container-flex-properties {
  33. display: flex;
  34. flex-wrap: inherit;
  35. align-items: center;
  36. justify-content: space-between;
  37. }
  38. > .container,
  39. > .container-fluid {
  40. @extend %container-flex-properties;
  41. }
  42. @each $breakpoint, $container-max-width in $container-max-widths {
  43. > .container#{breakpoint-infix($breakpoint, $container-max-widths)} {
  44. @extend %container-flex-properties;
  45. }
  46. }
  47. .container-fluid {
  48. position: relative;
  49. height: ($navbar-toggler-padding-y * 2) + $navbar-toggler-font-size + 1.625rem;
  50. }
  51. }
  52. // Navbar brand
  53. //
  54. // Used for brand, project, or site names.
  55. @font-face {
  56. font-family: 'Alegreya-Variable';
  57. src: url(../font/Alegreya-VariableFont_wght.ttf);
  58. }
  59. @font-face {
  60. font-family: 'Alegreya-Italic-Variable';
  61. src: url(../font/Alegreya-Italic-VariableFont_wght.ttf);
  62. }
  63. @font-face {
  64. font-family: 'Alegreya-Black';
  65. src: url(../font/Alegreya-Black.ttf);
  66. }
  67. @font-face {
  68. font-family: 'Alegreya-BlackItalic';
  69. src: url(../font/Alegreya-BlackItalic.ttf);
  70. }
  71. @font-face {
  72. font-family: 'Alegreya-Bold';
  73. src: url(../font/Alegreya-Bold.ttf);
  74. }
  75. @font-face {
  76. font-family: 'Alegreya-BoldItalic';
  77. src: url(../font/Alegreya-BoldItalic.ttf);
  78. }
  79. @font-face {
  80. font-family: 'Alegreya-ExtraBold';
  81. src: url(../font/Alegreya-ExtraBold.ttf);
  82. }
  83. @font-face {
  84. font-family: 'Alegreya-ExtraBoldItalic';
  85. src: url(../font/Alegreya-ExtraBoldItalic.ttf);
  86. }
  87. @font-face {
  88. font-family: 'Alegreya-Italic';
  89. src: url(../font/Alegreya-Italic.ttf);
  90. }
  91. @font-face {
  92. font-family: 'Alegreya-Medium';
  93. src: url(../font/Alegreya-Medium.ttf);
  94. }
  95. @font-face {
  96. font-family: 'Alegreya-MediumItalic';
  97. src: url(../font/Alegreya-MediumItalic.ttf);
  98. }
  99. @font-face {
  100. font-family: 'Alegreya';
  101. src: url(../font/Alegreya-Regular.ttf);
  102. }
  103. @font-face {
  104. font-family: 'Alegreya-SemiBold';
  105. src: url(../font/Alegreya-SemiBold.ttf);
  106. }
  107. @font-face {
  108. font-family: 'Alegreya-SemiBoldItalic';
  109. src: url(../font/Alegreya-SemiBoldItalic.ttf);
  110. }
  111. .navbar-brand {
  112. &.navbar-brand-logo {
  113. margin-left: $navbar-brand-margin-end * 2;
  114. padding-left: 120px;
  115. font-family: 'Alegreya-Black', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  116. // font-weight: bolder;
  117. color: $primary !important;
  118. font-size: 2rem;
  119. letter-spacing: 0.125rem;
  120. @include media-breakpoint-down(md) {
  121. padding-left: 15vw;
  122. margin-left: 5vw;
  123. }
  124. &::before {
  125. content: ' ';
  126. display: inline-block;
  127. width: 120px;
  128. height: 110px;
  129. position: absolute;
  130. left: 0;
  131. margin-left: math.div($navbar-brand-margin-end, 2);
  132. top: 50%;
  133. transform: translate(0, -50%);
  134. background-color: $body-bg;
  135. border-radius: 50%;
  136. border: math.div($navbar-brand-margin-end, 2) solid $body-bg;
  137. box-sizing: content-box;
  138. @include media-breakpoint-down(md) {
  139. width: 15vw;
  140. height: 15vw;
  141. }
  142. }
  143. &::after {
  144. content: ' ';
  145. background-image: url('../img/hbbq_logo.png');
  146. display: inline-block;
  147. position: absolute;
  148. top: 50%;
  149. left: 0;
  150. width: 120px;
  151. height: 120px;
  152. transform: translate(0, -50%);
  153. background-size: contain;
  154. background-repeat: no-repeat;
  155. background-position: center;
  156. margin-left: $navbar-brand-margin-end;
  157. border-bottom-left-radius: 50%;
  158. border-bottom-right-radius: 50%;
  159. border-bottom-style: dotted;
  160. border-color: $light;
  161. @include media-breakpoint-down(md) {
  162. width: 15vw;
  163. height: 15vw;
  164. }
  165. }
  166. }
  167. padding-top: $navbar-brand-padding-y;
  168. padding-bottom: $navbar-brand-padding-y;
  169. margin-right: $navbar-brand-margin-end;
  170. @include font-size($navbar-brand-font-size);
  171. text-decoration: if($link-decoration == none, null, none);
  172. white-space: nowrap;
  173. &:hover,
  174. &:focus {
  175. text-decoration: if($link-hover-decoration == underline, none, null);
  176. }
  177. }
  178. // Navbar nav
  179. //
  180. // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
  181. .navbar-nav {
  182. display: flex;
  183. flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
  184. padding-left: 0;
  185. margin-bottom: 0;
  186. list-style: none;
  187. .nav-link {
  188. padding-right: 0;
  189. padding-left: 0;
  190. }
  191. ul.dropdown-menu {
  192. li {
  193. .fa {
  194. padding-right: $dropdown-spacer * 4;
  195. min-width: 1.625rem;
  196. }
  197. }
  198. }
  199. }
  200. // Navbar text
  201. //
  202. //
  203. .navbar-text {
  204. padding-top: $nav-link-padding-y;
  205. padding-bottom: $nav-link-padding-y;
  206. }
  207. // Responsive navbar
  208. //
  209. // Custom styles for responsive collapsing and toggling of navbar contents.
  210. // Powered by the collapse Bootstrap JavaScript plugin.
  211. // When collapsed, prevent the toggleable navbar contents from appearing in
  212. // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
  213. // on the `.navbar` parent.
  214. .navbar-collapse {
  215. flex-basis: 100%;
  216. flex-grow: 1;
  217. // For always expanded or extra full navbars, ensure content aligns itself
  218. // properly vertically. Can be easily overridden with flex utilities.
  219. align-items: center;
  220. justify-content: flex-end;
  221. .navbar-nav {
  222. align-items: flex-end;
  223. .nav-item {
  224. padding-left: $navbar-brand-margin-end;
  225. .nav-link {
  226. padding-right: 1rem;
  227. padding-left: 0.5rem;
  228. }
  229. }
  230. }
  231. }
  232. // Button for toggling the navbar when in its collapsed state
  233. .navbar-toggler {
  234. padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
  235. @include font-size($navbar-toggler-font-size);
  236. line-height: 1;
  237. background-color: $white; // transparent; // remove default button style
  238. opacity: 0.5;
  239. border: 0; // $border-width solid transparent; // remove default button style
  240. @include border-radius($navbar-toggler-border-radius);
  241. @include transition($navbar-toggler-transition);
  242. &:hover {
  243. text-decoration: none;
  244. opacity: 1;
  245. }
  246. &:focus {
  247. text-decoration: none;
  248. outline: 0;
  249. box-shadow: 0 0 0 $navbar-toggler-focus-width;
  250. }
  251. }
  252. // Keep as a separate element so folks can easily override it with another icon
  253. // or image file as needed.
  254. .navbar-toggler-icon {
  255. display: inline-block;
  256. width: 1.5em;
  257. height: 1.5em;
  258. vertical-align: middle;
  259. background-repeat: no-repeat;
  260. background-position: center;
  261. background-size: 100%;
  262. }
  263. .navbar-nav-scroll {
  264. max-height: var(--#{$variable-prefix}scroll-height, 75vh);
  265. overflow-y: auto;
  266. }
  267. // scss-docs-start navbar-expand-loop
  268. // Generate series of `.navbar-expand-*` responsive classes for configuring
  269. // where your navbar collapses.
  270. .navbar-expand {
  271. @each $breakpoint in map-keys($grid-breakpoints) {
  272. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  273. $infix: breakpoint-infix($next, $grid-breakpoints);
  274. // stylelint-disable-next-line scss/selector-no-union-class-name
  275. &#{$infix} {
  276. @include media-breakpoint-up($next) {
  277. flex-wrap: nowrap;
  278. justify-content: flex-start;
  279. .navbar-nav {
  280. flex-direction: row;
  281. .dropdown-menu {
  282. position: absolute;
  283. }
  284. .nav-link {
  285. padding-right: $navbar-nav-link-padding-x;
  286. padding-left: $navbar-nav-link-padding-x;
  287. }
  288. }
  289. .navbar-nav-scroll {
  290. overflow: visible;
  291. }
  292. .navbar-collapse {
  293. display: flex !important; // stylelint-disable-line declaration-no-important
  294. flex-basis: auto;
  295. position: absolute;
  296. right: 0.5rem;
  297. }
  298. .navbar-toggler {
  299. display: none;
  300. }
  301. }
  302. }
  303. }
  304. }
  305. // scss-docs-end navbar-expand-loop
  306. // Navbar themes
  307. //
  308. // Styles for switching between navbars with light or dark background.
  309. // Dark links against a light background
  310. .navbar-light {
  311. .navbar-brand {
  312. color: $navbar-light-brand-color;
  313. @include media-breakpoint-down(lg) {
  314. flex: 1;
  315. font-size: calc(1rem + 1.5vw);
  316. white-space: nowrap;
  317. overflow-x: hidden;
  318. text-overflow: ellipsis;
  319. }
  320. &:hover,
  321. &:focus {
  322. color: $navbar-light-brand-hover-color;
  323. }
  324. }
  325. .navbar-nav {
  326. .nav-link {
  327. color: $navbar-light-color;
  328. &:hover,
  329. &:focus {
  330. color: $navbar-light-hover-color;
  331. }
  332. &.disabled {
  333. color: $navbar-light-disabled-color;
  334. }
  335. }
  336. .show > .nav-link,
  337. .nav-link.active {
  338. color: $navbar-light-active-color;
  339. }
  340. }
  341. .navbar-toggler {
  342. color: $navbar-light-color;
  343. border-color: $navbar-light-toggler-border-color;
  344. }
  345. .navbar-toggler-icon {
  346. background-image: escape-svg($navbar-light-toggler-icon-bg);
  347. }
  348. .navbar-text {
  349. color: $navbar-light-color;
  350. a,
  351. a:hover,
  352. a:focus {
  353. color: $navbar-light-active-color;
  354. }
  355. }
  356. }
  357. // White links against a dark background
  358. .navbar-dark {
  359. .navbar-brand {
  360. color: $navbar-dark-brand-color;
  361. &:hover,
  362. &:focus {
  363. color: $navbar-dark-brand-hover-color;
  364. }
  365. }
  366. .navbar-nav {
  367. .nav-link {
  368. color: $navbar-dark-color;
  369. &:hover,
  370. &:focus {
  371. color: $navbar-dark-hover-color;
  372. }
  373. &.disabled {
  374. color: $navbar-dark-disabled-color;
  375. }
  376. }
  377. .show > .nav-link,
  378. .nav-link.active {
  379. color: $navbar-dark-active-color;
  380. }
  381. }
  382. .navbar-toggler {
  383. color: $navbar-dark-color;
  384. border-color: $navbar-dark-toggler-border-color;
  385. }
  386. .navbar-toggler-icon {
  387. background-image: escape-svg($navbar-dark-toggler-icon-bg);
  388. }
  389. .navbar-text {
  390. color: $navbar-dark-color;
  391. a,
  392. a:hover,
  393. a:focus {
  394. color: $navbar-dark-active-color;
  395. }
  396. }
  397. }