accordion.css 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Accordion styles */
  2. #tabs .tab input[type='checkbox']{
  3. position: absolute;
  4. opacity: 0;
  5. z-index: -1;
  6. }
  7. .tabs {
  8. border-radius: 8px;
  9. overflow: hidden;
  10. box-shadow: 0 4px 4px -2px rgba(0, 0, 0, 0.5);
  11. }
  12. .tab {
  13. width: 100%;
  14. color: white;
  15. overflow: hidden;
  16. }
  17. .tab-label {
  18. display: flex;
  19. justify-content: space-between;
  20. padding: 1em;
  21. background: #fff;
  22. cursor: pointer;
  23. color: #221815;
  24. border-bottom: 1px solid #cdcccc;
  25. /* Icon */
  26. }
  27. .tab .tab-label:last-child{
  28. border-bottom: 0;
  29. }
  30. .tab-label:hover {
  31. background: #fff;
  32. color: #221815;
  33. }
  34. .tab-label::after {
  35. content: "❯";
  36. width: 1em;
  37. height: 1em;
  38. text-align: center;
  39. transition: all 0.35s;
  40. }
  41. .tab-content {
  42. max-height: 0;
  43. padding: 0 1em;
  44. color: #221815;
  45. background: white;
  46. transition: all 0.35s;
  47. }
  48. .tab-content li{
  49. border-bottom: 1px solid #ccc;
  50. }
  51. .tab-close {
  52. display: flex;
  53. justify-content: flex-end;
  54. padding: 1em;
  55. font-size: 0.75em;
  56. background: #2c3e50;
  57. cursor: pointer;
  58. }
  59. .tab-close:hover {
  60. background: #1a252f;
  61. }
  62. input:checked + .tab-label {
  63. background: #fff;
  64. color: #2c3e50;
  65. }
  66. input:checked + .tab-label::after {
  67. transform: rotate(90deg);
  68. }
  69. input:checked ~ .tab-content {
  70. max-height: 100vh;
  71. padding: 1em;
  72. }