Responsive Age Calculator using React

Solution retrospective
I found it difficult getting the font sizes to be responsive. Would appreciate feedback there.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Ragudos
Hello! I noticed that you used the vw unit for font sizes. It's great for responsiveness, however, I recommend adding a limit to that and some kind of breaker. For example:
clamp(10px, 2px + 5vw, 20px);
This means that the font size will be, at minimum, 10px, then increase by 2px per 5% of the viewport width, and once it reaches a font size of 20px, it stops there. You can also use the min() function:
min(2px + 5vw, 20px);
This means that the font size will be equals to the minimum value of the two, so if the value resulted from (2px + 5vw) is greater than 20px, then 20px will be the font-size, and vice versa.
The same is true for the max() function, but it takes the greater value instead of the lesser value.
Marked as helpful
Join 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