-1

The animation works fine, the block smoothly changes height only if I specify an exact height value.

.main {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(var(--main-color-rgb), .9);
    transition: var(--header-transition);
    display: flex;
}

.main.notActive {
    height: 80px;
}

when I want the height of the inactive state to depend on the content, the smoothness of the animation disappears.

.main.notActive {
    height: auto;
}

How can I fix this?

PS - a similar problem occurs with changing the value of 'display' and everything connected with it. For example, I can't change 'flex-direction' from 'column' to 'row' when transitioning. I'm losing fluidity. I think that these are close problems, so I added it here.

1 Answers1

0

you can use "min-height" with a great value for emulate this effect.