_tabs.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. $tab-label-height:3.5em;
  2. .tab-bar {
  3. @include clearfix;
  4. background: $accent-bg;
  5. margin: 0;
  6. padding: 0;
  7. list-style: none;
  8. font-family: $font-family-header;
  9. li {
  10. display: block;
  11. float: left;
  12. height: $tab-label-height;
  13. &.active {
  14. span, a {
  15. background: $content-bg;
  16. color: $content-fg;
  17. }
  18. }
  19. @include breakpoint(mobile-only) {
  20. width: 100%;
  21. span, a {
  22. width: 100%;
  23. text-align: center;
  24. }
  25. }
  26. }
  27. span, a {
  28. @extend .default-animation;
  29. display: inline-block;
  30. padding: 0 4rem;
  31. line-height: $tab-label-height;
  32. color: lighten($accent-bg,65%);
  33. &:hover {
  34. color: $white;
  35. background: darken($accent-bg,10%);
  36. }
  37. }
  38. }
  39. /* used for wrapper animation after the load of the page */
  40. @include keyframes(show) {
  41. from {
  42. opacity:0;
  43. }
  44. to {
  45. opacity:1;
  46. }
  47. }
  48. .form-tabs {
  49. background: $accent-bg;
  50. font-family: $font-family-header;
  51. margin-top: -4rem;
  52. @include breakpoint(mobile-only){
  53. padding-top: 4rem;
  54. }
  55. > input[type=radio] {
  56. display:none;
  57. &:checked{
  58. + label {
  59. background: $content-bg;
  60. color: $content-fg;
  61. }
  62. }
  63. }
  64. > label {
  65. @extend .default-animation;
  66. display:inline-block;
  67. cursor:pointer;
  68. color: lighten($accent-bg,65%);
  69. height: $tab-label-height;
  70. text-align:center;
  71. line-height: $tab-label-height;
  72. padding: 0 2rem;
  73. @include breakpoint(mobile-only){
  74. width: 100%;
  75. }
  76. &:last-of-type {
  77. border-bottom:none;
  78. }
  79. &:hover {
  80. color: $white;
  81. background: lighten($accent-bg,3%);
  82. }
  83. }
  84. }
  85. .tab-body {
  86. position:absolute;
  87. top:-9999px;
  88. opacity:0;
  89. width: 100%;
  90. }
  91. .tab-body-wrapper {
  92. padding-top: $tab-label-height;
  93. background: $content-bg;
  94. }
  95. #tab1:checked ~ .tab-body-wrapper #tab-body-1,
  96. #tab2:checked ~ .tab-body-wrapper #tab-body-2,
  97. #tab3:checked ~ .tab-body-wrapper #tab-body-3,
  98. #tab4:checked ~ .tab-body-wrapper #tab-body-4,
  99. #tab5:checked ~ .tab-body-wrapper #tab-body-5,
  100. #tab6:checked ~ .tab-body-wrapper #tab-body-6,
  101. #tab7:checked ~ .tab-body-wrapper #tab-body-7,
  102. #tab8:checked ~ .tab-body-wrapper #tab-body-8,
  103. #tab9:checked ~ .tab-body-wrapper #tab-body-9,
  104. #tab10:checked ~ .tab-body-wrapper #tab-body-10 {
  105. position:relative;
  106. top:0px;
  107. opacity: 1;
  108. }