Skip to content

Instantly share code, notes, and snippets.

@joellesenne
Created May 6, 2014 20:07
Show Gist options
  • Save joellesenne/40c9e5c1c77d6a74eff6 to your computer and use it in GitHub Desktop.
Save joellesenne/40c9e5c1c77d6a74eff6 to your computer and use it in GitHub Desktop.
A Pen by Johan Roug.

Easy SCSS font-size

Setting font-size and line-height, should be easy. With this CSS, you just type your sizes, and SASS make sit into ems. Quick and easy :)

A Pen by Johan Roug on CodePen.

License.

<h1>Easy SCSS <br>font-size</h1>
@import "compass/css3";
//Our base font size
//******************************************
$basicFontSize: 16;
//Just some styling START
//******************************************
body{
background: #272822;
color: #FD971F;
font-family: Verdana;
font-size: $basicFontSize;
}
//Mixin
//******************************************
@mixin font($fontSize, $lineHeight) {
font-size: ($fontSize/$basicFontSize)+em;
line-height: ($lineHeight/$fontSize)+em;
}
//Using the mixin
//******************************************
h1{
@include font(150,130);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment