My element's width changes under different conditions, and I've implemented CSS with a transition for the width:
.element-class {
transition: width 500ms ease 0ms;
}
However, I only want the transition to occur when the width is decreasing. If it increases, I want it to change immediately without a transition. Is there a way to specify that the transition property should only work in one specific scenario like this? Or is there an alternative approach?
I attempted to add two transition properties, but they do not apply simultaneously (which was expected, but I gave it a try).