0

I'm trying to use the solution here to dynamically resize text with a minimum size.

You can do it by using a formula and including the viewport width.

font-size: calc(7px + .5vw); 

This sets the minimum font size at 7px and amplifies it by .5vw depending on the viewport width.

The problem is that I'm using the LESS precompiler. I believe it is evaluating the calc() function at compile time and resolving to a static px value. I have confirmed this using Chrome dev tools on page that does the same thing both with and without LESS.

With LESS:

enter image description here

Without LESS:

enter image description here

So, how can I have my compiled CSS retain the calc() function?

THE JOATMON
  • 16,761
  • 34
  • 110
  • 200

0 Answers0