tabs.style.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. $background: #9b59b6;
  2. $tabs-base-color: #8e44ad;
  3. h1 {
  4. font-weight: normal;
  5. font-size: 40px;
  6. font-weight: normal;
  7. text-transform: uppercase;
  8. float: left;
  9. margin: 20px 0 100px 10px;
  10. span {
  11. font-size: 13px;
  12. display: block;
  13. padding-left: 4px;
  14. }
  15. }
  16. .tabs {
  17. width: 650px;
  18. float: none;
  19. list-style: none;
  20. position: relative;
  21. margin: 80px 0 0 10px;
  22. text-align: left;
  23. li {
  24. float: left;
  25. display: block;
  26. }
  27. input[type="radio"] {
  28. position: absolute;
  29. top: 0;
  30. left: -9999px;
  31. }
  32. label {
  33. display: block;
  34. padding: 14px 21px;
  35. border-radius: 2px 2px 0 0;
  36. font-size: 20px;
  37. font-weight: normal;
  38. text-transform: uppercase;
  39. background: $tabs-base-color;
  40. cursor: pointer;
  41. position: relative;
  42. top: 4px;
  43. @include transition(all 0.2s ease-in-out);
  44. &:hover {
  45. background: darken($tabs-base-color, 10);
  46. }
  47. }
  48. .tab-content {
  49. z-index: 2;
  50. display: none;
  51. overflow: hidden;
  52. width: 100%;
  53. font-size: 17px;
  54. line-height: 25px;
  55. padding: 25px;
  56. position: absolute;
  57. top: 53px;
  58. left: 0;
  59. background: darken($tabs-base-color, 15);
  60. }
  61. //The Magic
  62. [id^="tab"]:checked + label {
  63. top: 0;
  64. padding-top: 17px;
  65. background: darken($tabs-base-color, 15);
  66. }
  67. [id^="tab"]:checked ~ [id^="tab-content"] {
  68. display: block;
  69. }
  70. }
  71. p.link {
  72. clear: both;
  73. margin: 380px 0 0 15px;
  74. a {
  75. text-transform: uppercase;
  76. text-decoration: none;
  77. display: inline-block;
  78. color: #fff;
  79. padding: 5px 10px;
  80. margin: 0 5px;
  81. background-color: darken($tabs-base-color, 15);
  82. @include transition(all 0.2s ease-in);
  83. &:hover {
  84. background-color: darken($tabs-base-color, 20);
  85. }
  86. }
  87. }