_faq.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. .faq {
  2. display: flex;
  3. flex-direction: column;
  4. gap: 16px;
  5. &__title {
  6. margin:0;
  7. margin-bottom: 24px;
  8. font-weight: 600;
  9. color: var(--text-color);
  10. }
  11. &__item {
  12. border-radius: 12px;
  13. overflow: hidden;
  14. transition: all 0.3s ease;
  15. border: 1px solid var(--content-border-color);
  16. background: var(--content-bg-color);
  17. &.active {
  18. .faq__question::after {
  19. transform: rotate(45deg);
  20. }
  21. .faq__question::before {
  22. transform: rotate(-45deg);
  23. }
  24. .faq__answer {
  25. opacity: 1;
  26. }
  27. }
  28. }
  29. &__question {
  30. padding: 20px 56px 20px 24px;
  31. cursor: pointer;
  32. position: relative;
  33. user-select: none;
  34. transition: background-color 0.2s ease;
  35. display: flex;
  36. align-items: center;
  37. gap: 16px;
  38. h3 {
  39. margin: 0;
  40. font-size: 16px;
  41. font-weight: 500;
  42. line-height: 24px;
  43. color: var(--text-color);
  44. }
  45. // Крестик с псевдоэлементами
  46. &::before,
  47. &::after {
  48. content: '';
  49. position: absolute;
  50. right: 24px;
  51. top: 50%;
  52. width: 16px;
  53. height: 2px;
  54. background-color: var(--text-color);
  55. transition: transform 0.3s ease;
  56. }
  57. &::before {
  58. transform: translateY(-50%);
  59. }
  60. &::after {
  61. transform: translateY(-50%) rotate(90deg);
  62. }
  63. }
  64. &__number {
  65. display: flex;
  66. width: 32px;
  67. height: 32px;
  68. flex-direction: column;
  69. justify-content: center;
  70. align-items: center;
  71. gap: 10px;
  72. aspect-ratio: 1/1;
  73. font-weight: 600;
  74. background-color: var(--accent-color);
  75. color: var(--text-color);
  76. min-width: 32px;
  77. flex-shrink: 0;
  78. border-radius:50%;
  79. }
  80. &__question-title {
  81. flex: 1;
  82. font-size: 16px;
  83. font-weight: 500;
  84. line-height: 24px;
  85. color: var(--text-color);
  86. }
  87. &__answer {
  88. max-height: 0;
  89. opacity: 0;
  90. overflow: hidden;
  91. transition: all 0.3s ease;
  92. border-top:1px dashed var(--content-border-color);
  93. p {
  94. margin: 0;
  95. font-size: 14px;
  96. line-height: 22px;
  97. color: var(--text-color);
  98. opacity: 0.8;
  99. }
  100. }
  101. &__answer-inner{
  102. padding: 24px;
  103. }
  104. }