@DarkstarXDD
Posted
- Have you checked
clamp()
? It is exactly what you need here.
@SunilParbhoo
Posted
@DarkstarXDD Thanks for the feedback! Yes, I forgot to mention I did play around with the clamp() method and calc() method, however I was unsuccessful in getting the middle value of clamp to be based off a container width that changes sizes. I tried searching the MDN docs on the clamp method, among other resources.
@DarkstarXDD
Posted
@SunilParbhoo I am not sure how to use the container width as the preferred value (middle value). I usually use the viewport width (vw) as that value, which will make the resulting value change when the screen size changes. So for example on larger screens the font-size will be larger and on smaller screens the font-size will be smaller, eliminating the need of a media query. Are you sure you need to use the containers width and not the screen size? If so you will have to search around a bit how you can use that.
Marked as helpful