_navbar.scss 10 KB

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