Responsive Typography

It appears that by using calc() and vw we can get responsive typography that scales perfectly between specific pixel values within a specific viewport range.

The problem with the common approach to responsive typography is that it is jumpy and requires a lot of media queries.

Viewport units are fluid but lack precise control over font-size.

Typically you might use a table like this to work out the range of font sizes across different resolutions.

Viewport units: 1vw 2vw 3vw 4vw 5vw
Viewport size font-size in pixels
400px 4px 8px 12px 16px 20px
500px 5px 10px 15px 20px 25px
600px 6px 12px 18px 24px 30px
700px 7px 14px 21px 28px 35px
800px 8px 16px 24px 32px 40px
900px 9px 18px 27px 36px 45px
1000px 10px 20px 30px 40px 50px
1100px 11px 22px 33px 44px 55px
1200px 12px 24px 36px 48px 60px

Looking at the table you can see there are many limitations. There is no way to scale between 16px and 36px for example over the given viewport sizes. That is a shame because this is the type of control designers expect (and should expect).

Imagine you want the smallest font-size to be 12 pixels and then once the device width is greater than 400px you want the font-size to gradually increase to 24px and stop scaling by the time the viewport reaches 800px. That is exactly what this demo does!

This is achieved by using viewport units in combination with calc(). Unfortunately there are still some bugs when using calc() and viewport units together, so this might be buggy in some browsers. Tested in Chrome and Firefox.

More details here: http://madebymike.com.au/writing/precise-control-responsive-typography/