_navbar.scss 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  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 +
  50. 1.625rem;
  51. }
  52. }
  53. // Navbar brand
  54. //
  55. // Used for brand, project, or site names.
  56. @font-face {
  57. font-family: "Alegreya";
  58. src: url(../font/Alegreya-VariableFont_wght.ttf);
  59. }
  60. @font-face {
  61. font-family: "Alegreya-Italic";
  62. src: url(../font/Alegreya-Italic-VariableFont_wght.ttf);
  63. }
  64. .navbar-brand {
  65. &.navbar-brand-logo {
  66. margin-left: $navbar-brand-margin-end * 2;
  67. padding-left: 120px;
  68. font-family: "Alegreya", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  69. font-weight: bolder;
  70. color: $primary !important;
  71. font-size: 2rem;
  72. &::before {
  73. content: " ";
  74. display: inline-block;
  75. width: 120px;
  76. height: 110px;
  77. position: absolute;
  78. left: 0;
  79. margin-left: math.div($navbar-brand-margin-end, 2);
  80. top: 50%;
  81. transform: translate(0, -50%);
  82. background-color: $body-bg;
  83. border-radius: 50%;
  84. border: math.div($navbar-brand-margin-end, 2) solid $body-bg;
  85. box-sizing: content-box;
  86. }
  87. &::after {
  88. content: " ";
  89. background-image: url("../img/hbbq_logo.png");
  90. display: inline-block;
  91. position: absolute;
  92. top: 50%;
  93. left: 0;
  94. width: 120px;
  95. height: 120px;
  96. transform: translate(0, -50%);
  97. background-size: contain;
  98. background-repeat: no-repeat;
  99. background-position: center;
  100. margin-left: $navbar-brand-margin-end;
  101. border-bottom-left-radius: 50%;
  102. border-bottom-right-radius: 50%;
  103. border-bottom-style: dotted;
  104. border-color: $light;
  105. }
  106. }
  107. padding-top: $navbar-brand-padding-y;
  108. padding-bottom: $navbar-brand-padding-y;
  109. margin-right: $navbar-brand-margin-end;
  110. @include font-size($navbar-brand-font-size);
  111. text-decoration: if($link-decoration == none, null, none);
  112. white-space: nowrap;
  113. &:hover,
  114. &:focus {
  115. text-decoration: if($link-hover-decoration == underline, none, null);
  116. }
  117. }
  118. // Navbar nav
  119. //
  120. // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
  121. .navbar-nav {
  122. display: flex;
  123. flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
  124. padding-left: 0;
  125. margin-bottom: 0;
  126. list-style: none;
  127. .nav-link {
  128. padding-right: 0;
  129. padding-left: 0;
  130. }
  131. // .dropdown-menu {
  132. // position: static;
  133. // }
  134. }
  135. // Navbar text
  136. //
  137. //
  138. .navbar-text {
  139. padding-top: $nav-link-padding-y;
  140. padding-bottom: $nav-link-padding-y;
  141. }
  142. // Responsive navbar
  143. //
  144. // Custom styles for responsive collapsing and toggling of navbar contents.
  145. // Powered by the collapse Bootstrap JavaScript plugin.
  146. // When collapsed, prevent the toggleable navbar contents from appearing in
  147. // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
  148. // on the `.navbar` parent.
  149. .navbar-collapse {
  150. flex-basis: 100%;
  151. flex-grow: 1;
  152. // For always expanded or extra full navbars, ensure content aligns itself
  153. // properly vertically. Can be easily overridden with flex utilities.
  154. align-items: center;
  155. justify-content: flex-end;
  156. .navbar-nav {
  157. align-items: flex-end;
  158. .nav-item {
  159. padding-left: $navbar-brand-margin-end;
  160. .nav-link {
  161. padding-right: 1rem;
  162. padding-left: 0.5rem;
  163. }
  164. }
  165. }
  166. }
  167. // Button for toggling the navbar when in its collapsed state
  168. .navbar-toggler {
  169. padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
  170. @include font-size($navbar-toggler-font-size);
  171. line-height: 1;
  172. background-color: $white; // transparent; // remove default button style
  173. opacity: 0.5;
  174. border: 0; // $border-width solid transparent; // remove default button style
  175. @include border-radius($navbar-toggler-border-radius);
  176. @include transition($navbar-toggler-transition);
  177. &:hover {
  178. text-decoration: none;
  179. opacity: 1;
  180. }
  181. &:focus {
  182. text-decoration: none;
  183. outline: 0;
  184. box-shadow: 0 0 0 $navbar-toggler-focus-width;
  185. }
  186. }
  187. // Keep as a separate element so folks can easily override it with another icon
  188. // or image file as needed.
  189. .navbar-toggler-icon {
  190. display: inline-block;
  191. width: 1.5em;
  192. height: 1.5em;
  193. vertical-align: middle;
  194. background-repeat: no-repeat;
  195. background-position: center;
  196. background-size: 100%;
  197. }
  198. .navbar-nav-scroll {
  199. max-height: var(--#{$variable-prefix}scroll-height, 75vh);
  200. overflow-y: auto;
  201. }
  202. // scss-docs-start navbar-expand-loop
  203. // Generate series of `.navbar-expand-*` responsive classes for configuring
  204. // where your navbar collapses.
  205. .navbar-expand {
  206. @each $breakpoint in map-keys($grid-breakpoints) {
  207. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  208. $infix: breakpoint-infix($next, $grid-breakpoints);
  209. // stylelint-disable-next-line scss/selector-no-union-class-name
  210. &#{$infix} {
  211. @include media-breakpoint-up($next) {
  212. flex-wrap: nowrap;
  213. justify-content: flex-start;
  214. .navbar-nav {
  215. flex-direction: row;
  216. .dropdown-menu {
  217. position: absolute;
  218. }
  219. .nav-link {
  220. padding-right: $navbar-nav-link-padding-x;
  221. padding-left: $navbar-nav-link-padding-x;
  222. }
  223. }
  224. .navbar-nav-scroll {
  225. overflow: visible;
  226. }
  227. .navbar-collapse {
  228. display: flex !important; // stylelint-disable-line declaration-no-important
  229. flex-basis: auto;
  230. position: absolute;
  231. right: 0.5rem;
  232. }
  233. .navbar-toggler {
  234. display: none;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. // scss-docs-end navbar-expand-loop
  241. // Navbar themes
  242. //
  243. // Styles for switching between navbars with light or dark background.
  244. // Dark links against a light background
  245. .navbar-light {
  246. .navbar-brand {
  247. color: $navbar-light-brand-color;
  248. @include media-breakpoint-down(lg) {
  249. flex: 1;
  250. font-size: calc(1.375rem + 1.5vw);
  251. white-space: nowrap;
  252. overflow-x: hidden;
  253. text-overflow: ellipsis;
  254. }
  255. &:hover,
  256. &:focus {
  257. color: $navbar-light-brand-hover-color;
  258. }
  259. }
  260. .navbar-nav {
  261. .nav-link {
  262. color: $navbar-light-color;
  263. &:hover,
  264. &:focus {
  265. color: $navbar-light-hover-color;
  266. }
  267. &.disabled {
  268. color: $navbar-light-disabled-color;
  269. }
  270. }
  271. .show > .nav-link,
  272. .nav-link.active {
  273. color: $navbar-light-active-color;
  274. }
  275. }
  276. .navbar-toggler {
  277. color: $navbar-light-color;
  278. border-color: $navbar-light-toggler-border-color;
  279. }
  280. .navbar-toggler-icon {
  281. background-image: escape-svg($navbar-light-toggler-icon-bg);
  282. }
  283. .navbar-text {
  284. color: $navbar-light-color;
  285. a,
  286. a:hover,
  287. a:focus {
  288. color: $navbar-light-active-color;
  289. }
  290. }
  291. }
  292. // White links against a dark background
  293. .navbar-dark {
  294. .navbar-brand {
  295. color: $navbar-dark-brand-color;
  296. &:hover,
  297. &:focus {
  298. color: $navbar-dark-brand-hover-color;
  299. }
  300. }
  301. .navbar-nav {
  302. .nav-link {
  303. color: $navbar-dark-color;
  304. &:hover,
  305. &:focus {
  306. color: $navbar-dark-hover-color;
  307. }
  308. &.disabled {
  309. color: $navbar-dark-disabled-color;
  310. }
  311. }
  312. .show > .nav-link,
  313. .nav-link.active {
  314. color: $navbar-dark-active-color;
  315. }
  316. }
  317. .navbar-toggler {
  318. color: $navbar-dark-color;
  319. border-color: $navbar-dark-toggler-border-color;
  320. }
  321. .navbar-toggler-icon {
  322. background-image: escape-svg($navbar-dark-toggler-icon-bg);
  323. }
  324. .navbar-text {
  325. color: $navbar-dark-color;
  326. a,
  327. a:hover,
  328. a:focus {
  329. color: $navbar-dark-active-color;
  330. }
  331. }
  332. }