Difference Between flex: 1 and flex: auto
Both flex: 1 and flex: auto are commonly used shorthand values for the flex property, but they behave slightly differently due to their underlying flex-grow, flex-shrink, and flex-basis values.
flex: 1 → Equivalent to flex: 1 1 0;. The item will grow to fill available space, can shrink if necessary, and starts with a base size of 0.
flex: auto → Equivalent to flex: 1 1 auto;. The item will grow and shrink like flex: 1, but its base size is determined by its content (auto) instead of 0.
In short, flex: 1 treats the item as starting from zero width/height and distributes space, whereas flex: auto respects the item's intrinsic size before distributing remaining space.