nav.sass 2.5 KB

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