Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don’t have a good resource, but min, max, minmax are good if you have a responsive layout where elements change (under a parent container in vh, vw, %) but you also want to have a threshold that is not exceeded. Like min-width or max-width, but as a value instead of the explicit css property, which means you can set properties to equal that value.

MDN has some good explainers: https://developer.mozilla.org/en-US/docs/Web/CSS/clamp



Thanks. After reading your explanation it became clearer that the reason you use clamp is because you're using different units (e.g. rem vs %, px vs vw) and varying page dimensions may affect those units differently (e.g. 10% may be larger or smaller than 100px depending on the parent's width).

Here I read the entire MDN article on clamp and it didn't click in my mind until you explained it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: