_navbar.scss 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  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. &::before {
  120. content: ' ';
  121. display: inline-block;
  122. width: 120px;
  123. height: 110px;
  124. position: absolute;
  125. left: 0;
  126. margin-left: math.div($navbar-brand-margin-end, 2);
  127. top: 50%;
  128. transform: translate(0, -50%);
  129. background-color: $body-bg;
  130. border-radius: 50%;
  131. border: math.div($navbar-brand-margin-end, 2) solid $body-bg;
  132. box-sizing: content-box;
  133. }
  134. &::after {
  135. content: ' ';
  136. background-image: url('../img/hbbq_logo.png');
  137. display: inline-block;
  138. position: absolute;
  139. top: 50%;
  140. left: 0;
  141. width: 120px;
  142. height: 120px;
  143. transform: translate(0, -50%);
  144. background-size: contain;
  145. background-repeat: no-repeat;
  146. background-position: center;
  147. margin-left: $navbar-brand-margin-end;
  148. border-bottom-left-radius: 50%;
  149. border-bottom-right-radius: 50%;
  150. border-bottom-style: dotted;
  151. border-color: $light;
  152. }
  153. }
  154. padding-top: $navbar-brand-padding-y;
  155. padding-bottom: $navbar-brand-padding-y;
  156. margin-right: $navbar-brand-margin-end;
  157. @include font-size($navbar-brand-font-size);
  158. text-decoration: if($link-decoration == none, null, none);
  159. white-space: nowrap;
  160. &:hover,
  161. &:focus {
  162. text-decoration: if($link-hover-decoration == underline, none, null);
  163. }
  164. }
  165. // Navbar nav
  166. //
  167. // Custom navbar navigation (doesn't require `.nav`, but does make use of `.nav-link`).
  168. .navbar-nav {
  169. display: flex;
  170. flex-direction: column; // cannot use `inherit` to get the `.navbar`s value
  171. padding-left: 0;
  172. margin-bottom: 0;
  173. list-style: none;
  174. .nav-link {
  175. padding-right: 0;
  176. padding-left: 0;
  177. }
  178. // .dropdown-menu {
  179. // position: static;
  180. // }
  181. }
  182. // Navbar text
  183. //
  184. //
  185. .navbar-text {
  186. padding-top: $nav-link-padding-y;
  187. padding-bottom: $nav-link-padding-y;
  188. }
  189. // Responsive navbar
  190. //
  191. // Custom styles for responsive collapsing and toggling of navbar contents.
  192. // Powered by the collapse Bootstrap JavaScript plugin.
  193. // When collapsed, prevent the toggleable navbar contents from appearing in
  194. // the default flexbox row orientation. Requires the use of `flex-wrap: wrap`
  195. // on the `.navbar` parent.
  196. .navbar-collapse {
  197. flex-basis: 100%;
  198. flex-grow: 1;
  199. // For always expanded or extra full navbars, ensure content aligns itself
  200. // properly vertically. Can be easily overridden with flex utilities.
  201. align-items: center;
  202. justify-content: flex-end;
  203. .navbar-nav {
  204. align-items: flex-end;
  205. .nav-item {
  206. padding-left: $navbar-brand-margin-end;
  207. .nav-link {
  208. padding-right: 1rem;
  209. padding-left: 0.5rem;
  210. }
  211. }
  212. }
  213. }
  214. // Button for toggling the navbar when in its collapsed state
  215. .navbar-toggler {
  216. padding: $navbar-toggler-padding-y $navbar-toggler-padding-x;
  217. @include font-size($navbar-toggler-font-size);
  218. line-height: 1;
  219. background-color: $white; // transparent; // remove default button style
  220. opacity: 0.5;
  221. border: 0; // $border-width solid transparent; // remove default button style
  222. @include border-radius($navbar-toggler-border-radius);
  223. @include transition($navbar-toggler-transition);
  224. &:hover {
  225. text-decoration: none;
  226. opacity: 1;
  227. }
  228. &:focus {
  229. text-decoration: none;
  230. outline: 0;
  231. box-shadow: 0 0 0 $navbar-toggler-focus-width;
  232. }
  233. }
  234. // Keep as a separate element so folks can easily override it with another icon
  235. // or image file as needed.
  236. .navbar-toggler-icon {
  237. display: inline-block;
  238. width: 1.5em;
  239. height: 1.5em;
  240. vertical-align: middle;
  241. background-repeat: no-repeat;
  242. background-position: center;
  243. background-size: 100%;
  244. }
  245. .navbar-nav-scroll {
  246. max-height: var(--#{$variable-prefix}scroll-height, 75vh);
  247. overflow-y: auto;
  248. }
  249. // scss-docs-start navbar-expand-loop
  250. // Generate series of `.navbar-expand-*` responsive classes for configuring
  251. // where your navbar collapses.
  252. .navbar-expand {
  253. @each $breakpoint in map-keys($grid-breakpoints) {
  254. $next: breakpoint-next($breakpoint, $grid-breakpoints);
  255. $infix: breakpoint-infix($next, $grid-breakpoints);
  256. // stylelint-disable-next-line scss/selector-no-union-class-name
  257. &#{$infix} {
  258. @include media-breakpoint-up($next) {
  259. flex-wrap: nowrap;
  260. justify-content: flex-start;
  261. .navbar-nav {
  262. flex-direction: row;
  263. .dropdown-menu {
  264. position: absolute;
  265. }
  266. .nav-link {
  267. padding-right: $navbar-nav-link-padding-x;
  268. padding-left: $navbar-nav-link-padding-x;
  269. }
  270. }
  271. .navbar-nav-scroll {
  272. overflow: visible;
  273. }
  274. .navbar-collapse {
  275. display: flex !important; // stylelint-disable-line declaration-no-important
  276. flex-basis: auto;
  277. position: absolute;
  278. right: 0.5rem;
  279. }
  280. .navbar-toggler {
  281. display: none;
  282. }
  283. }
  284. }
  285. }
  286. }
  287. // scss-docs-end navbar-expand-loop
  288. // Navbar themes
  289. //
  290. // Styles for switching between navbars with light or dark background.
  291. // Dark links against a light background
  292. .navbar-light {
  293. .navbar-brand {
  294. color: $navbar-light-brand-color;
  295. @include media-breakpoint-down(lg) {
  296. flex: 1;
  297. font-size: calc(1rem + 1.5vw);
  298. white-space: nowrap;
  299. overflow-x: hidden;
  300. text-overflow: ellipsis;
  301. }
  302. &:hover,
  303. &:focus {
  304. color: $navbar-light-brand-hover-color;
  305. }
  306. }
  307. .navbar-nav {
  308. .nav-link {
  309. color: $navbar-light-color;
  310. &:hover,
  311. &:focus {
  312. color: $navbar-light-hover-color;
  313. }
  314. &.disabled {
  315. color: $navbar-light-disabled-color;
  316. }
  317. }
  318. .show > .nav-link,
  319. .nav-link.active {
  320. color: $navbar-light-active-color;
  321. }
  322. }
  323. .navbar-toggler {
  324. color: $navbar-light-color;
  325. border-color: $navbar-light-toggler-border-color;
  326. }
  327. .navbar-toggler-icon {
  328. background-image: escape-svg($navbar-light-toggler-icon-bg);
  329. }
  330. .navbar-text {
  331. color: $navbar-light-color;
  332. a,
  333. a:hover,
  334. a:focus {
  335. color: $navbar-light-active-color;
  336. }
  337. }
  338. }
  339. // White links against a dark background
  340. .navbar-dark {
  341. .navbar-brand {
  342. color: $navbar-dark-brand-color;
  343. &:hover,
  344. &:focus {
  345. color: $navbar-dark-brand-hover-color;
  346. }
  347. }
  348. .navbar-nav {
  349. .nav-link {
  350. color: $navbar-dark-color;
  351. &:hover,
  352. &:focus {
  353. color: $navbar-dark-hover-color;
  354. }
  355. &.disabled {
  356. color: $navbar-dark-disabled-color;
  357. }
  358. }
  359. .show > .nav-link,
  360. .nav-link.active {
  361. color: $navbar-dark-active-color;
  362. }
  363. }
  364. .navbar-toggler {
  365. color: $navbar-dark-color;
  366. border-color: $navbar-dark-toggler-border-color;
  367. }
  368. .navbar-toggler-icon {
  369. background-image: escape-svg($navbar-dark-toggler-icon-bg);
  370. }
  371. .navbar-text {
  372. color: $navbar-dark-color;
  373. a,
  374. a:hover,
  375. a:focus {
  376. color: $navbar-dark-active-color;
  377. }
  378. }
  379. }