_tabs.scss 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. // Foundation by ZURB
  2. // foundation.zurb.com
  3. // Licensed under MIT Open Source
  4. @import 'global';
  5. @import 'grid';
  6. //
  7. // @variables
  8. //
  9. $include-html-tabs-classes: $include-html-classes !default;
  10. $tabs-navigation-padding: rem-calc(16) !default;
  11. $tabs-navigation-bg-color: $silver !default;
  12. $tabs-navigation-active-bg-color: $white !default;
  13. $tabs-navigation-hover-bg-color: scale-color($tabs-navigation-bg-color, $lightness: -6%) !default;
  14. $tabs-navigation-font-color: $jet !default;
  15. $tabs-navigation-active-font-color: $tabs-navigation-font-color !default;
  16. $tabs-navigation-font-size: rem-calc(16) !default;
  17. $tabs-navigation-font-family: $body-font-family !default;
  18. $tabs-content-margin-bottom: rem-calc(24) !default;
  19. $tabs-content-padding: ($column-gutter/2) !default;
  20. $tabs-vertical-navigation-margin-bottom: 1.25rem !default;
  21. @include exports("tab") {
  22. @if $include-html-tabs-classes {
  23. .tabs {
  24. @include clearfix;
  25. margin-bottom: 0 !important;
  26. margin-left: 0;
  27. dd,
  28. .tab-title {
  29. float: $default-float;
  30. list-style: none;
  31. margin-bottom: 0 !important;
  32. position: relative;
  33. > a {
  34. display: block;
  35. background-color: $tabs-navigation-bg-color;
  36. color: $tabs-navigation-font-color;
  37. font-family: $tabs-navigation-font-family;
  38. font-size: $tabs-navigation-font-size;
  39. padding: $tabs-navigation-padding $tabs-navigation-padding * 2;
  40. &:hover {
  41. background-color: $tabs-navigation-hover-bg-color;
  42. }
  43. }
  44. &.active > a {
  45. background-color: $tabs-navigation-active-bg-color;
  46. color: $tabs-navigation-active-font-color;
  47. }
  48. }
  49. &.radius {
  50. dd:first-child,
  51. .tab:first-child {
  52. a { @include side-radius($default-float, $global-radius); }
  53. }
  54. dd:last-child,
  55. .tab:last-child {
  56. a { @include side-radius($opposite-direction, $global-radius); }
  57. }
  58. }
  59. &.vertical {
  60. dd,
  61. .tab-title {
  62. position: inherit;
  63. float: none;
  64. display: block;
  65. top: auto;
  66. }
  67. }
  68. }
  69. .tabs-content {
  70. @include clearfix;
  71. margin-bottom: $tabs-content-margin-bottom;
  72. width: 100%;
  73. > .content {
  74. display: none;
  75. float: $default-float;
  76. padding: $tabs-content-padding 0;
  77. width: 100%;
  78. &.active {
  79. display: block;
  80. float: none;
  81. }
  82. &.contained {
  83. padding: $tabs-content-padding;
  84. }
  85. }
  86. &.vertical {
  87. display: block;
  88. > .content {
  89. padding: 0 $tabs-content-padding;
  90. }
  91. }
  92. }
  93. @media #{$medium-up} {
  94. .tabs {
  95. &.vertical {
  96. float: $default-float;
  97. margin: 0;
  98. margin-bottom: $tabs-vertical-navigation-margin-bottom !important;
  99. max-width: 20%;
  100. width: 20%;
  101. }
  102. }
  103. .tabs-content {
  104. &.vertical {
  105. float: $default-float;
  106. margin-#{$default-float}: -1px;
  107. max-width: 80%;
  108. padding-#{$default-float}: 1rem;
  109. width: 80%;
  110. }
  111. }
  112. }
  113. .no-js {
  114. .tabs-content > .content {
  115. display: block;
  116. float: none;
  117. }
  118. }
  119. }
  120. }