Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SASS, How can I escape the slash character in a font declaration?

Tags:

sass

I'm writing a font declaration with short-hand syntax, and I'm using SASS. I'd like to escape the '/' character to avoid SASS makes the divition operation.

$fontSize: 14px;
$lineHeight: 16px;
$fontName: Arial;

body
{
    font: $fontSize/$lineHeight $fontName;
}

This gets compiled to:

font: 0.875 Arial;

What I want to get is something like:

font: 14px/16px Arial;

Any ideas?

like image 907
alonso.torres Avatar asked Aug 10 '11 18:08

alonso.torres


1 Answers

font: #{$fontSize}/#{$lineHeight} $fontName should do it.

like image 177
Natalie Weizenbaum Avatar answered Nov 05 '22 23:11

Natalie Weizenbaum