Design comparison
SolutionDesign
Solution retrospective
What specific areas of your project would you like help with?
I’m using calc()
and clamp()
functions to manage various CSS properties such as margin, padding, font-size, and border-radius. Here are a few examples from my project:
/* Margin with clamp() and calc() */
.recipe-img {
margin: clamp(25px, calc(3.5vw + 2px), calc(var(--spacing-unit) * 3.5)) auto;
}
/* Padding with calc() */
.preparation-time {
padding: calc(var(--spacing-unit) * 2);
}
/* Margin and border-radius with calc() */
.recipe-details {
margin: calc(var(--spacing-unit) * 10) 0;
border-radius: calc(var(--border-radius) * 2);
}
-
Is this approach effective for managing responsive and adaptive designs?**
-
Are there best practices or common issues I should be aware of when using these functions for margin, padding, font-size, and border-radius?
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord