Submitted by Aaron Craig on Tue, 04/10/2012 - 12:03pm

If you're using LESS, you can also create a mixin:

.font-size(@value) {
@pixels: @value * 10;
font-size: e("@{pixels}px");
font-size: e("@{value}rem");
}

Saves typing, and you just insert the rem value like:

body {
.font-size(2);
}

The content of this field is kept private and will not be shown publicly.

Plain text

  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.