_navbar.scss 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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. // .dropdown-menu {
  192. // position: static;
  193. // }
  194. }
  195. // Navbar text
  196. //
  197. //
  198. .navbar-text {
  199. padding-top: $nav-link-padding-y;
  200. padding-bottom: $nav-link-padding-y;
  201. }
  202. // Responsive navbar
  203. //
  204. // Custom styles for responsive collapsing and toggling of navbar contents.
  205. // Powered by the collapse Bootstrap JavaScript plugin.
  206. // When collapsed, prevent the toggleable navbar contents from appearing in
  207. // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
  208. // on the `.navbar` parent.
  209. .navbar-collapse {
  210. flex-basis: 100%;
  211. flex-grow: 1;
  212. // For always expanded or extra full navbars, ensure content aligns itself
  213. // properly vertically. Can be easily overridden with flex utilities.
  214. align-items: center;
  215. justify-content: flex-end;
  216. .navbar-nav {
  217. align-items: flex-end;
  218. .nav-item {
  219. padding-left: $navbar-brand-margin-end;
  220. .nav-link {
  221. padding-right: 1rem;
  222. padding-left: 0.5rem;
  223. }
  224. }
  225. }
  226. }
  227. // Button for toggling the navbar when in its collapsed state
  228. .navbar-toggler {
  229. padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
  230. @include font-size($navbar-toggler-font-size);
  231. line-height: 1;
  232. background-color: $white; // transparent; // remove default button style
  233. opacity: 0.5;
  234. border: 0; // $border-width solid transparent; // remove default button style
  235. @include border-radius($navbar-toggler-border-radius);
  236. @include transition($navbar-toggler-transition);
  237. &:hover {
  238. text-decoration: none;
  239. opacity: 1;
  240. }
  241. &:focus {
  242. text-decoration: none;
  243. outline: 0;
  244. box-shadow: 0 0 0 $navbar-toggler-focus-width;
  245. }
  246. }
  247. // Keep as a separate element so folks can easily override it with another icon
  248. // or image file as needed.
  249. .navbar-toggler-icon {
  250. display: inline-block;
  251. width: 1.5em;
  252. height: 1.5em;
  253. vertical-align: middle;
  254. background-repeat: no-repeat;
  255. background-position: center;
  256. background-size: 100%;
  257. }
  258. .navbar-nav-scroll {
  259. max-height: var(--#{$variable-prefix}scroll-height, 75vh);
  260. overflow-y: auto;
  261. }
  262. // scss-docs-start navbar-expand-loop
  263. // Generate series of `.navbar-expand-*` responsive classes for configuring
  264. // where your navbar collapses.
  265. .navbar-expand {
  266. @each $breakpoint in map-keys($grid-breakpoints) {
  267. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  268. $infix: breakpoint-infix($next, $grid-breakpoints);
  269. // stylelint-disable-next-line scss/selector-no-union-class-name
  270. &#{$infix} {
  271. @include media-breakpoint-up($next) {
  272. flex-wrap: nowrap;
  273. justify-content: flex-start;
  274. .navbar-nav {
  275. flex-direction: row;
  276. .dropdown-menu {
  277. position: absolute;
  278. }
  279. .nav-link {
  280. padding-right: $navbar-nav-link-padding-x;
  281. padding-left: $navbar-nav-link-padding-x;
  282. }
  283. }
  284. .navbar-nav-scroll {
  285. overflow: visible;
  286. }
  287. .navbar-collapse {
  288. display: flex !important; // stylelint-disable-line declaration-no-important
  289. flex-basis: auto;
  290. position: absolute;
  291. right: 0.5rem;
  292. }
  293. .navbar-toggler {
  294. display: none;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. // scss-docs-end navbar-expand-loop
  301. // Navbar themes
  302. //
  303. // Styles for switching between navbars with light or dark background.
  304. // Dark links against a light background
  305. .navbar-light {
  306. .navbar-brand {
  307. color: $navbar-light-brand-color;
  308. @include media-breakpoint-down(lg) {
  309. flex: 1;
  310. font-size: calc(1rem + 1.5vw);
  311. white-space: nowrap;
  312. overflow-x: hidden;
  313. text-overflow: ellipsis;
  314. }
  315. &:hover,
  316. &:focus {
  317. color: $navbar-light-brand-hover-color;
  318. }
  319. }
  320. .navbar-nav {
  321. .nav-link {
  322. color: $navbar-light-color;
  323. &:hover,
  324. &:focus {
  325. color: $navbar-light-hover-color;
  326. }
  327. &.disabled {
  328. color: $navbar-light-disabled-color;
  329. }
  330. }
  331. .show > .nav-link,
  332. .nav-link.active {
  333. color: $navbar-light-active-color;
  334. }
  335. }
  336. .navbar-toggler {
  337. color: $navbar-light-color;
  338. border-color: $navbar-light-toggler-border-color;
  339. }
  340. .navbar-toggler-icon {
  341. background-image: escape-svg($navbar-light-toggler-icon-bg);
  342. }
  343. .navbar-text {
  344. color: $navbar-light-color;
  345. a,
  346. a:hover,
  347. a:focus {
  348. color: $navbar-light-active-color;
  349. }
  350. }
  351. }
  352. // White links against a dark background
  353. .navbar-dark {
  354. .navbar-brand {
  355. color: $navbar-dark-brand-color;
  356. &:hover,
  357. &:focus {
  358. color: $navbar-dark-brand-hover-color;
  359. }
  360. }
  361. .navbar-nav {
  362. .nav-link {
  363. color: $navbar-dark-color;
  364. &:hover,
  365. &:focus {
  366. color: $navbar-dark-hover-color;
  367. }
  368. &.disabled {
  369. color: $navbar-dark-disabled-color;
  370. }
  371. }
  372. .show > .nav-link,
  373. .nav-link.active {
  374. color: $navbar-dark-active-color;
  375. }
  376. }
  377. .navbar-toggler {
  378. color: $navbar-dark-color;
  379. border-color: $navbar-dark-toggler-border-color;
  380. }
  381. .navbar-toggler-icon {
  382. background-image: escape-svg($navbar-dark-toggler-icon-bg);
  383. }
  384. .navbar-text {
  385. color: $navbar-dark-color;
  386. a,
  387. a:hover,
  388. a:focus {
  389. color: $navbar-dark-active-color;
  390. }
  391. }
  392. }