_navbar.scss 8.6 KB

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