nav.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // Components
  2. .nav-toggle {
  3. @extend .hamburger;
  4. // Responsiveness
  5. @include tablet {
  6. display: none;
  7. }
  8. }
  9. .nav-item {
  10. align-items: center;
  11. display: flex;
  12. justify-content: center;
  13. padding: 10px;
  14. a {
  15. flex-grow: 1;
  16. }
  17. img {
  18. max-height: 24px;
  19. }
  20. .button + .button {
  21. margin-left: 10px;
  22. }
  23. .tag {
  24. &:first-child {
  25. margin-right: 5px;
  26. }
  27. &:last-child {
  28. margin-left: 5px;
  29. }
  30. }
  31. // Responsiveness
  32. @include mobile {
  33. justify-content: flex-start;
  34. }
  35. }
  36. .nav-item a,
  37. a.nav-item {
  38. color: $text;
  39. &:hover {
  40. color: $link-hover;
  41. }
  42. // Modifiers
  43. &.is-active {
  44. color: $link-active;
  45. }
  46. &.is-tab {
  47. border-bottom: 1px solid transparent;
  48. border-top: 1px solid transparent;
  49. padding-left: 12px;
  50. padding-right: 12px;
  51. &:hover {
  52. border-bottom: 1px solid $link;
  53. border-top: 1px solid transparent;
  54. }
  55. &.is-active {
  56. border-bottom: 3px solid $link;
  57. border-top: 3px solid transparent;
  58. color: $link;
  59. }
  60. }
  61. }
  62. // Containers
  63. .nav-menu {
  64. // Responsiveness
  65. @include mobile {
  66. background-color: $white;
  67. box-shadow: 0 4px 7px rgba($black, 0.1);
  68. left: 0;
  69. display: none;
  70. right: 0;
  71. top: 100%;
  72. position: absolute;
  73. .nav-item {
  74. border-top: 1px solid rgba($border, 0.5);
  75. padding: 10px;
  76. }
  77. &.is-active {
  78. display: block;
  79. }
  80. }
  81. @include tablet-only {
  82. padding-right: 20px;
  83. }
  84. }
  85. .nav-left {
  86. align-items: stretch;
  87. display: flex;
  88. flex-basis: 0;
  89. flex-grow: 1;
  90. justify-content: flex-start;
  91. overflow: hidden;
  92. overflow-x: auto;
  93. white-space: nowrap;
  94. }
  95. .nav-center {
  96. align-items: stretch;
  97. display: flex;
  98. justify-content: center;
  99. margin-left: auto;
  100. margin-right: auto;
  101. }
  102. .nav-right {
  103. // Responsiveness
  104. @include tablet {
  105. align-items: stretch;
  106. display: flex;
  107. flex-basis: 0;
  108. flex-grow: 1;
  109. justify-content: flex-end;
  110. }
  111. }
  112. // Main container
  113. .nav {
  114. align-items: stretch;
  115. background-color: $white;
  116. display: flex;
  117. min-height: $nav-height;
  118. position: relative;
  119. text-align: center;
  120. z-index: 2;
  121. & > .container {
  122. align-items: stretch;
  123. display: flex;
  124. min-height: $nav-height;
  125. width: 100%;
  126. & > .nav-left {
  127. & > .nav-item:first-child:not(.is-tab) {
  128. padding-left: 0;
  129. }
  130. }
  131. & > .nav-right {
  132. & > .nav-item:last-child:not(.is-tab) {
  133. padding-right: 0;
  134. }
  135. }
  136. }
  137. .container > & {
  138. & > .nav-left {
  139. & > .nav-item:first-child:not(.is-tab) {
  140. padding-left: 0;
  141. }
  142. }
  143. & > .nav-right {
  144. & > .nav-item:last-child:not(.is-tab) {
  145. padding-right: 0;
  146. }
  147. }
  148. }
  149. // Modifiers
  150. &.has-shadow {
  151. box-shadow: 0 2px 3px rgba($black, 0.1);
  152. }
  153. // Responsiveness
  154. @include touch {
  155. & > .container,
  156. .container > & {
  157. & > .nav-left {
  158. & > .nav-item.is-brand:first-child {
  159. padding-left: 20px;
  160. }
  161. }
  162. }
  163. }
  164. }