div {
width: min(50vw, 300px);
}The min() function chooses the smallest value between 50vw (50% of viewport width) and 300px. So the box width will never exceed 300px and will shrink if 50vw is smaller.
The max() function picks the larger value between 200px and 30vh, ensuring the height is never less than 200px but grows with viewport height.
The correct pattern to clamp a value between a minimum and maximum is max(minimum, min(value, maximum)). Here, it ensures font size is at least 1rem, at most 2rem, scaling with 5vw.
.container { width: max(300px, min(50vw, 400px)); }
50vw of 600px is 300px. Then min(50vw, 400px) is min(300px, 400px) = 300px. Then max(300px, 300px) is 300px. So the width is 300px.
Using min() and max() lets designers set size boundaries so text and elements stay readable and usable on all screen sizes, which helps accessibility.