_tabs.scss 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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, .tab-title {
  28. float: $default-float;
  29. list-style: none;
  30. margin-bottom: 0 !important;
  31. position: relative;
  32. > a {
  33. display: block;
  34. background: {
  35. color: $tabs-navigation-bg-color;
  36. }
  37. color: $tabs-navigation-font-color;
  38. font-family: $tabs-navigation-font-family;
  39. font-size: $tabs-navigation-font-size;
  40. padding: $tabs-navigation-padding $tabs-navigation-padding * 2;
  41. &:hover {
  42. background: {
  43. color: $tabs-navigation-hover-bg-color;
  44. }
  45. }
  46. }
  47. &.active a {
  48. background: {
  49. color: $tabs-navigation-active-bg-color;
  50. }
  51. color:$tabs-navigation-active-font-color;
  52. }
  53. }
  54. &.radius {
  55. dd:first-child, .tab:first-child {
  56. a { @include side-radius($default-float, $global-radius); }
  57. }
  58. dd:last-child, .tab:last-child {
  59. a { @include side-radius($opposite-direction, $global-radius); }
  60. }
  61. }
  62. &.vertical {
  63. dd, .tab-title {
  64. position: inherit;
  65. float: none;
  66. display: block;
  67. top: auto;
  68. }
  69. }
  70. }
  71. .tabs-content {
  72. @include clearfix;
  73. margin-bottom: $tabs-content-margin-bottom;
  74. width: 100%;
  75. > .content {
  76. display: none;
  77. float: $default-float;
  78. padding: $tabs-content-padding 0;
  79. width: 100%;
  80. &.active { display: block; float: none; }
  81. &.contained { padding: $tabs-content-padding; }
  82. }
  83. &.vertical {
  84. display: block;
  85. > .content { padding: 0 $tabs-content-padding; }
  86. }
  87. }
  88. @media #{$medium-up} {
  89. .tabs {
  90. &.vertical {
  91. float: $default-float;
  92. margin: 0 0 $tabs-vertical-navigation-margin-bottom;
  93. max-width: 20%;
  94. width: 20%;
  95. }
  96. }
  97. .tabs-content {
  98. &.vertical {
  99. float: $default-float;
  100. margin-#{$default-float}: -1px;
  101. max-width: 80%;
  102. padding-#{$default-float}: 1rem;
  103. width: 80%;
  104. }
  105. }
  106. }
  107. .no-js {
  108. .tabs-content > .content {
  109. display: block;
  110. float: none;
  111. }
  112. }
  113. }
  114. }