use cases for calc
I never know when I should use the calc property.
What are some good use cases for it?
5 Replies
You'll find a good example here: https://css-tricks.com/a-complete-guide-to-calc-in-css/
I think I use it most often to make perfect nested corner radiuses
I recently used it to build an implicit grid where I needed elements to keep a certain aspect-ratio

basically every time you need to do any math, which depending on the case might be a lot of times or else.
there's also this article from yesterday where basically it's all calc!
Thanks so much Martin 🫡