Home Download Buy Blog Forum Support

font-size & line-height plugin

font-size & line-height plugin

Postby parallax on Thu Jul 10, 2014 4:41 pm


I thought some people (especially the CSS purists out there) may be interested in a plugin I just made:


It generates font-size and line-height em values based on px values. If you find yourself using Spotlight Search's maths functions or Calculator to figure out font-size and line-height em values.

You want to use em units for fonts & your base font-size is 15px. You'd like a font-size of 20px, line-height of 24px.

.my-class {

Highlight 15/20/24 & press your keybinding (see fslh.sublime-keymap for an example, mine uses Cmd+Shift+L), and the result will be:

.my-class {
font-size: 1.3333333333em;
line-height: 1.2em;

Of course, in SASS you could use something like:

@function em($pixels) {
@return $pixels / $base-font-size + em;

But I thought I'd share anyway!

Parallax Agency
Posts: 1
Joined: Thu Jul 10, 2014 4:37 pm
Location: Leeds & London

Return to Plugin Announcements

Who is online

Users browsing this forum: Yahoo [Bot] and 4 guests