tabs.sass 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. @import "../utilities/mixins"
  2. $tabs-border-bottom-color: $border !default
  3. $tabs-border-bottom-style: solid !default
  4. $tabs-border-bottom-width: 1px !default
  5. $tabs-link-color: $text !default
  6. $tabs-link-hover-border-bottom-color: $text-strong !default
  7. $tabs-link-hover-color: $text-strong !default
  8. $tabs-link-active-border-bottom-color: $link !default
  9. $tabs-link-active-color: $link !default
  10. $tabs-link-padding: 0.5em 1em !default
  11. $tabs-boxed-link-radius: $radius !default
  12. $tabs-boxed-link-hover-background-color: $background !default
  13. $tabs-boxed-link-hover-border-bottom-color: $border !default
  14. $tabs-boxed-link-active-background-color: $scheme-main !default
  15. $tabs-boxed-link-active-border-color: $border !default
  16. $tabs-boxed-link-active-border-bottom-color: transparent !default
  17. $tabs-toggle-link-border-color: $border !default
  18. $tabs-toggle-link-border-style: solid !default
  19. $tabs-toggle-link-border-width: 1px !default
  20. $tabs-toggle-link-hover-background-color: $background !default
  21. $tabs-toggle-link-hover-border-color: $border-hover !default
  22. $tabs-toggle-link-radius: $radius !default
  23. $tabs-toggle-link-active-background-color: $link !default
  24. $tabs-toggle-link-active-border-color: $link !default
  25. $tabs-toggle-link-active-color: $link-invert !default
  26. .tabs
  27. @extend %block
  28. +overflow-touch
  29. @extend %unselectable
  30. align-items: stretch
  31. display: flex
  32. font-size: $size-normal
  33. justify-content: space-between
  34. overflow: hidden
  35. overflow-x: auto
  36. white-space: nowrap
  37. a
  38. align-items: center
  39. border-bottom-color: $tabs-border-bottom-color
  40. border-bottom-style: $tabs-border-bottom-style
  41. border-bottom-width: $tabs-border-bottom-width
  42. color: $tabs-link-color
  43. display: flex
  44. justify-content: center
  45. margin-bottom: -#{$tabs-border-bottom-width}
  46. padding: $tabs-link-padding
  47. vertical-align: top
  48. &:hover
  49. border-bottom-color: $tabs-link-hover-border-bottom-color
  50. color: $tabs-link-hover-color
  51. li
  52. display: block
  53. &.is-active
  54. a
  55. border-bottom-color: $tabs-link-active-border-bottom-color
  56. color: $tabs-link-active-color
  57. ul
  58. align-items: center
  59. border-bottom-color: $tabs-border-bottom-color
  60. border-bottom-style: $tabs-border-bottom-style
  61. border-bottom-width: $tabs-border-bottom-width
  62. display: flex
  63. flex-grow: 1
  64. flex-shrink: 0
  65. justify-content: flex-start
  66. &.is-left
  67. padding-right: 0.75em
  68. &.is-center
  69. flex: none
  70. justify-content: center
  71. padding-left: 0.75em
  72. padding-right: 0.75em
  73. &.is-right
  74. justify-content: flex-end
  75. padding-left: 0.75em
  76. .icon
  77. &:first-child
  78. +ltr-property("margin", 0.5em)
  79. &:last-child
  80. +ltr-property("margin", 0.5em, false)
  81. // Alignment
  82. &.is-centered
  83. ul
  84. justify-content: center
  85. &.is-right
  86. ul
  87. justify-content: flex-end
  88. // Styles
  89. &.is-boxed
  90. a
  91. border: 1px solid transparent
  92. +ltr
  93. border-radius: $tabs-boxed-link-radius $tabs-boxed-link-radius 0 0
  94. +rtl
  95. border-radius: 0 0 $tabs-boxed-link-radius $tabs-boxed-link-radius
  96. &:hover
  97. background-color: $tabs-boxed-link-hover-background-color
  98. border-bottom-color: $tabs-boxed-link-hover-border-bottom-color
  99. li
  100. &.is-active
  101. a
  102. background-color: $tabs-boxed-link-active-background-color
  103. border-color: $tabs-boxed-link-active-border-color
  104. border-bottom-color: $tabs-boxed-link-active-border-bottom-color !important
  105. &.is-fullwidth
  106. li
  107. flex-grow: 1
  108. flex-shrink: 0
  109. &.is-toggle
  110. a
  111. border-color: $tabs-toggle-link-border-color
  112. border-style: $tabs-toggle-link-border-style
  113. border-width: $tabs-toggle-link-border-width
  114. margin-bottom: 0
  115. position: relative
  116. &:hover
  117. background-color: $tabs-toggle-link-hover-background-color
  118. border-color: $tabs-toggle-link-hover-border-color
  119. z-index: 2
  120. li
  121. & + li
  122. +ltr-property("margin", -#{$tabs-toggle-link-border-width}, false)
  123. &:first-child a
  124. +ltr
  125. border-top-left-radius: $tabs-toggle-link-radius
  126. border-bottom-left-radius: $tabs-toggle-link-radius
  127. +rtl
  128. border-top-right-radius: $tabs-toggle-link-radius
  129. border-bottom-right-radius: $tabs-toggle-link-radius
  130. &:last-child a
  131. +ltr
  132. border-top-right-radius: $tabs-toggle-link-radius
  133. border-bottom-right-radius: $tabs-toggle-link-radius
  134. +rtl
  135. border-top-left-radius: $tabs-toggle-link-radius
  136. border-bottom-left-radius: $tabs-toggle-link-radius
  137. &.is-active
  138. a
  139. background-color: $tabs-toggle-link-active-background-color
  140. border-color: $tabs-toggle-link-active-border-color
  141. color: $tabs-toggle-link-active-color
  142. z-index: 1
  143. ul
  144. border-bottom: none
  145. &.is-toggle-rounded
  146. li
  147. &:first-child a
  148. +ltr
  149. border-bottom-left-radius: $radius-rounded
  150. border-top-left-radius: $radius-rounded
  151. padding-left: 1.25em
  152. +rtl
  153. border-bottom-right-radius: $radius-rounded
  154. border-top-right-radius: $radius-rounded
  155. padding-right: 1.25em
  156. &:last-child a
  157. +ltr
  158. border-bottom-right-radius: $radius-rounded
  159. border-top-right-radius: $radius-rounded
  160. padding-right: 1.25em
  161. +rtl
  162. border-bottom-left-radius: $radius-rounded
  163. border-top-left-radius: $radius-rounded
  164. padding-left: 1.25em
  165. // Sizes
  166. &.is-small
  167. font-size: $size-small
  168. &.is-medium
  169. font-size: $size-medium
  170. &.is-large
  171. font-size: $size-large