Design comparison
Solution retrospective
Using clamp()
for responsive typography without media queries so that the text wasn't squished on mobile screens.
I also gave more thought to accessibility.
What challenges did you encounter, and how did you overcome them?N/A
What specific areas of your project would you like help with?To come up with the dynamic value for clamp()
(the second value), I divided the mobile font size by the mobile screen width. So for example, the body text had to be 14px on mobile and the mobile screen size is 375px. So 14 / 375 = 0.0373. So the dynamic value I used in clamp()
was 3.75vw. I'm not sure if this is the best way to come up with the value but it worked well enough for all the different text presets in this challenge. However I'd like to know if there are better practices for determining the dynamic clamp value.
I'd also like my BEM class names to be reviewed.
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