For the majority of website projects I use modular scales to set the typographic harmony. You can get an overview of this technique in the first section of Tim Brown’s excellent A List Apart article.

Basically, you choose a starting point and then use the golden ratio (1.618) to calculate the rest of the sizes.

I’m a big fan of Sass so I was curious if I could use a mixin to automatically calculate a font size based on the Golden Ratio and two user-defined default values. Thereby forcing a modular scale as long as you stuck to outputting the font size with this mixin. Answer (spoiler alert): yes.

Keep reading →