Здрасте. Возникла очередная проблема и возможно я задаю очень заезженный вопрос. Почему при изменении высоты с 0 до 100% нет плавности даже при использовании transtition. Хотел добиться плавности с помощью transform scale но это выглядит не так красиво ка хотелось бы. Можете объяснить как добиться плавности для height
HTML
<!-- GROUP -->
<ul class="faqs-block__questions">
<!-- ITEM -->
<li class="faqs-block-quetions__item">
<!-- TITLE -->
<div class="faqs-block-question__title">
<!-- IMG -->
<div class="faqs-block-question-title__img">
<img
src="../../IMG/ASSETS/ICONS/arrow-black.svg"
alt="arrow"
/>
</div>
<!-- TEXT -->
<h2 class="component-te-1">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur sodales ?
</h2>
</div>
<!-- CONTENT -->
<div class="faqs-block-question__content">
<h2 class="component-te-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur sodales eleifend dolor vel cursus. Fusce in ligula
ut leo eleifend lobortis fringilla non elit. Vivamus mollis,
odio ac finibus rutrum, libero augue venenatis leo, in
maximus ipsum dui et est.
</h2>
</div>
</li>
<!-- ITEM -->
<li class="faqs-block-quetions__item">
<!-- TITLE -->
<div class="faqs-block-question__title">
<!-- IMG -->
<div class="faqs-block-question-title__img">
<img
src="../../IMG/ASSETS/ICONS/arrow-black.svg"
alt="arrow"
/>
</div>
<!-- TEXT -->
<h2 class="component-te-1">
Lorem ipsum dolor sit amet, consectetur adipiscing ?
</h2>
</div>
<!-- CONTENT -->
<div class="faqs-block-question__content">
<h2 class="component-te-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Curabitur sodales eleifend dolor vel cursus. Fusce in ligula
ut leo eleifend lobortis fringilla non elit. Vivamus mollis,
odio ac finibus rutrum, libero augue venenatis leo, in
maximus ipsum dui et est.
</h2>
</div>
</li>
</ul>
CSS
/* GROUP */
.faqs-block__questions {
display: flex;
row-gap: 20px;
flex-flow: wrap column;
}
/* --ITEM */
.faqs-block-quetions__item {
border-bottom: 1px solid blue;
}
/* ----TITLE */
.faqs-block-question__title {
display: flex;
align-items: center;
column-gap: 7px;
}
.faqs-block-question__title h2 {
color: var(--darkGrey);
font-family: Montserrat;
font-size: 20px;
font-weight: 700;
text-transform: capitalize;
}
/* ------IMG */
.faqs-block-question-title__img {
transform: rotate(0deg);
transition: 0.2s all linear;
}
.faqs-block-quetions__item.--active .faqs-block-question-title__img {
transform: rotate(180deg);
}
/* ----CONTENT */
.faqs-block-question__content {
line-height: 26px;
margin: 15px 0;
transform-origin: center top;
height: 0;
overflow: hidden;
}
.faqs-block-quetions__item.--active .faqs-block-question__content {
height: 100%;
}
JS
const textBtns = document.querySelectorAll(".faqs-block-question__title");
textBtns.forEach((el) => {
el.addEventListener("click", () => {
el.parentNode.classList.toggle("--active");
});
});