_navigation-top.scss 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. /*--------------------------------------------------------------*/
  2. /* !## Top Navigation */
  3. /*--------------------------------------------------------------*/
  4. /*
  5. * Top Navigation
  6. */
  7. .top-navigation {
  8. clear: both;
  9. display: table;
  10. float: none;
  11. position: relative;
  12. text-align: left;
  13. width: 100%;
  14. align-self: flex-end;
  15. z-index: 10;
  16. .col-width {
  17. width: 100%;
  18. }
  19. & > div {
  20. background: $color__background-body;
  21. float: right;
  22. height: auto;
  23. max-height: 0;
  24. opacity: 0;
  25. overflow: hidden;
  26. position: relative;
  27. width: 100%;
  28. -webkit-transition: max-height 0.3s ease, opacity 0.3s ease;
  29. -moz-transition: max-height all 0.3s ease, opacity 0.3s ease;
  30. transition: max-height all 0.3s ease, opacity 0.3s ease;
  31. & > ul {
  32. margin-top: $baseline;
  33. text-align: left;
  34. }
  35. }
  36. ul {
  37. list-style: none;
  38. margin: 0;
  39. padding: 0;
  40. }
  41. li {
  42. a {
  43. display: block;
  44. @include list-item();
  45. padding: 1em ($gutter * .5);
  46. }
  47. &.current_page_ancestor > a,
  48. &.current-page-parent > a,
  49. &.current_page_item > a,
  50. & > a:focus {
  51. text-decoration: underline;
  52. }
  53. }
  54. /*
  55. * Sub-menus
  56. */
  57. .sub-menu,
  58. .children {
  59. height: auto;
  60. max-height: 0;
  61. visibility: hidden;
  62. opacity: 0;
  63. overflow: hidden;
  64. position: relative;
  65. width: 100%;
  66. li > a {
  67. margin-left: ($gutter + 3);
  68. padding-left: 0;
  69. position: relative;
  70. &:after {
  71. content: '\2022';
  72. font-family: 'FontAwesome';
  73. font-weight: normal;
  74. left: -15px;
  75. position: absolute;
  76. top: 5px;
  77. }
  78. }
  79. &.toggled-on {
  80. max-height: 9999px;
  81. opacity: 1;
  82. visibility: visible;
  83. width: 100%;
  84. }
  85. }
  86. }
  87. /*
  88. * Dropdown toggle buttons
  89. */
  90. .dropdown-toggle {
  91. background: $color__background-body;
  92. border: 1px solid $color__border-transparent;
  93. box-shadow: 0 0 0 $color__border-transparent;
  94. color: $color__text-main;
  95. display: inline-block;
  96. height: 32px;
  97. line-height: 5px;
  98. margin: 0;
  99. padding: 3px;
  100. speak: none;
  101. z-index: 5;
  102. width: 32px;
  103. -moz-border-radius: 20px;
  104. -webkit-border-radius: 20px;
  105. -khtml-border-radius: 20px;
  106. border-radius: 20px;
  107. .meta-nav .dropdown-icon .line {
  108. fill: none;
  109. stroke-width: 1px;
  110. stroke: $color__text-main;
  111. stroke-miterlimit: 10;
  112. }
  113. .meta-nav .dropdown-icon-close {
  114. display: none;
  115. }
  116. &:active,
  117. &:focus {
  118. border-color: $color__border-transparent;
  119. }
  120. &:hover {
  121. background: $color__link;
  122. border-color: $color__link;
  123. box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.25);
  124. .meta-nav .dropdown-icon .line {
  125. stroke: $color__background-body;
  126. }
  127. }
  128. &.toggled-on {
  129. background: $color__link;
  130. border-color: $color__link;
  131. box-shadow: 0 0 0 $color__border-transparent;
  132. & > div {
  133. max-height: 9999px;
  134. opacity: 1;
  135. z-index: 999;
  136. }
  137. .meta-nav .dropdown-icon-open {
  138. display: none;
  139. }
  140. .meta-nav .dropdown-icon-close {
  141. display: inline-block;
  142. }
  143. .meta-nav .dropdown-icon .line {
  144. stroke: $color__background-body;
  145. }
  146. }
  147. }
  148. /*
  149. * Menu Toggle
  150. */
  151. .menu-toggle {
  152. @include list-header();
  153. background: $color__background-body;
  154. cursor: pointer;
  155. display: none;
  156. font-weight: 500;
  157. line-height: 20px;
  158. text-align: left;
  159. .meta-nav {
  160. display: inline-block;
  161. height: 18px;
  162. width: 16px;
  163. vertical-align: middle;
  164. .menu-icon .line {
  165. fill: none;
  166. stroke: $color__text-main;
  167. stroke-miterlimit:10;
  168. }
  169. .menu-icon-close {
  170. display: none;
  171. }
  172. }
  173. &:hover .meta-nav {
  174. .menu-icon .line {
  175. stroke: $color__background-body;
  176. }
  177. }
  178. &:active .meta-nav,
  179. &:focus .meta-nav {
  180. .menu-icon .line {
  181. stroke: $color__background-body;
  182. }
  183. }
  184. &[aria-expanded="true"] .meta-nav {
  185. .menu-icon-open {
  186. display: none;
  187. }
  188. .menu-icon-close {
  189. display: block;
  190. }
  191. }
  192. }
  193. /*--------------------------------------------------------------*/
  194. /* !## Mobile and Down Navigation */
  195. /*--------------------------------------------------------------*/
  196. @include breakpoint( mobileonly ) {
  197. /*
  198. * Top Navigation
  199. */
  200. .top-navigation {
  201. display: block;
  202. padding: 0;
  203. text-align: right;
  204. @include transition( max-height, 0.3s, ease );
  205. @include transition( opacity, 0.3s, ease );
  206. &.toggled-on > div {
  207. background: transparent;
  208. max-height: 9999px;
  209. opacity: 1;
  210. width: 100%;
  211. z-index: 999;
  212. & > ul {
  213. margin-top: 0;
  214. }
  215. }
  216. /*
  217. * Sub-menu top borders
  218. *
  219. * Using a psuedo class for top borders in
  220. * menu on mobile so that we don't need
  221. * media queries in our color annotations.
  222. */
  223. .sub-menu,
  224. .children {
  225. border-top: none;
  226. position: relative;
  227. padding-left: ($gutter * .6);
  228. -webkit-transition: all 0.375s ease;
  229. -moz-transition: all 0.375s ease;
  230. transition: all 0.375s ease;
  231. &:before,
  232. &:before {
  233. content: "";
  234. border-top: 1px solid $color__border-transparent;
  235. height: 1px;
  236. left: 0;
  237. position: absolute;
  238. top: 0;
  239. width: 100%;
  240. }
  241. li > a:after {
  242. top: 15px;
  243. }
  244. }
  245. /*
  246. * Sub-menu bottom borders
  247. *
  248. * Using a psuedo class for bottom borders
  249. * in menu on mobile so that we don't need
  250. * media queries in our color annotations.
  251. **/
  252. & > div > ul {
  253. border-top: 1px solid $color__border-transparent;
  254. }
  255. li {
  256. position: relative;
  257. a {
  258. position: relative;
  259. z-index: 1;
  260. }
  261. &:after {
  262. content: "";
  263. bottom: 0;
  264. border-bottom: 1px solid $color__border-transparent;
  265. height: 1px;
  266. left: 0;
  267. position: absolute;
  268. width: 100%;
  269. }
  270. &.sub-menu,
  271. &.children {
  272. li > a:after {
  273. top: ($gutter * .5 + 3px);
  274. }
  275. }
  276. &.menu-item-has-children > a {
  277. padding-right: ($gutter * 1.75);
  278. }
  279. }
  280. ul:last-of-type > li:last-of-type:after {
  281. border-bottom: none;
  282. }
  283. &[style] {
  284. min-height: inherit !important;
  285. }
  286. }
  287. /*
  288. * Dropdown toggle buttons
  289. */
  290. .dropdown-toggle {
  291. position: absolute;
  292. right: 5px;
  293. top: 5px;
  294. &:after {
  295. line-height: 0.2;
  296. }
  297. }
  298. /*
  299. * Menu Toggle
  300. */
  301. .menu-toggle {
  302. bottom: calc( 100% + #{$mobile-baseline} );
  303. display: block;
  304. padding: ($baseline * .5) ($gutter * .5);
  305. position: absolute;
  306. right: 10px;
  307. }
  308. }
  309. /*--------------------------------------------------------------*/
  310. /* !## Phablet and Up Navigation */
  311. /*--------------------------------------------------------------*/
  312. @include breakpoint( phablet ) {
  313. /*
  314. * Top Navigation
  315. */
  316. .top-navigation {
  317. display: inline-block;
  318. font-size: 16px;
  319. height: inherit;
  320. margin: 0;
  321. overflow: visible;
  322. position: relative;
  323. vertical-align: middle;
  324. width: 30%;
  325. & > div {
  326. display: flex;
  327. float: none;
  328. flex-wrap: nowrap;
  329. max-height: inherit;
  330. position: relative;
  331. opacity: 1;
  332. overflow: visible;
  333. width: 100%;
  334. }
  335. div > ul {
  336. list-style-type: none;
  337. margin: 0;
  338. padding: 0;
  339. position: relative;
  340. text-align: left;
  341. z-index: 1;
  342. // Top-level list items
  343. & > li {
  344. display: block;
  345. position: relative;
  346. z-index: 2;
  347. a {
  348. display: inline-block;
  349. padding: 5px 8px;
  350. text-align: left;
  351. }
  352. // Top-level menu items with sub-menus
  353. &.menu-item-has-children {
  354. margin-left: -20px;
  355. & > a {
  356. margin-left: 28px;
  357. padding-left: 0;
  358. }
  359. }
  360. &.toggled-on {
  361. box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.25);
  362. }
  363. }
  364. // All other ist items
  365. li {
  366. &.toggled-on {
  367. @include animation('bounce-reveal-y .25s cubic-bezier(0.645, 0.045, 0.355, 1)');
  368. background: $color__link;
  369. z-index: 3;
  370. a {
  371. color: #FFF;
  372. }
  373. }
  374. }
  375. & > li > .sub-menu,
  376. & > li > .children {
  377. border-top: 1px solid $color__background-body;
  378. }
  379. }
  380. .sub-menu,
  381. .children {
  382. background: $color__link;
  383. box-shadow: 2px 3px 4px rgba(0, 0, 0, 0.25);
  384. position: absolute;
  385. z-index: 10;
  386. li {
  387. position: relative;
  388. a {
  389. color: $color__background-body;
  390. }
  391. }
  392. & > li.toggled-on {
  393. border-top: 1px solid $color__background-body;
  394. margin-top: -1px;
  395. }
  396. .sub-menu,
  397. .children {
  398. border-bottom: 1px solid $color__background-body;
  399. box-shadow: 0 0 0 $color__border-transparent;
  400. margin-bottom: -1px;
  401. padding-left: ($gutter * .6);
  402. position: relative;
  403. }
  404. }
  405. }
  406. /*
  407. * Dropdown toggle buttons
  408. */
  409. .dropdown-toggle {
  410. border: none;
  411. box-shadow: none;
  412. float: left;
  413. height: 20px;
  414. left: 5px;
  415. padding: 1px;
  416. position: absolute;
  417. top: 3px;
  418. width: 20px;
  419. &:focus {
  420. box-shadow: none;
  421. }
  422. }
  423. }
  424. /*--------------------------------------------------------------*/
  425. /* !## Tablet and Up Navigation */
  426. /*--------------------------------------------------------------*/
  427. @include breakpoint( tablet ) {
  428. .top-navigation {
  429. clear: right;
  430. float: right;
  431. }
  432. }