Skip to content

Instantly share code, notes, and snippets.

@mistermark
Created March 21, 2015 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mistermark/f0148a05123489a5ee9f to your computer and use it in GitHub Desktop.
Save mistermark/f0148a05123489a5ee9f to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
@function strip-unit($value) {
@return $value / ($value * 0 + 1);
}
@function em($px, $base: $font-size) {
@return (strip-unit($px) / strip-unit($base)) * 1em;
}
$font-size: 16px;
$line-height: em($font-size * 1.5);
$em: em($font-size);
.em {
line-height: $em;
}
@mixin huge {
/* 42px / 48px */
font-size: em(42);
line-height: $line-height * 2; //48px
}
h1 {
@include huge;
}
@mixin large {
/* 26 / 36px */
font-size: em(26px);
line-height: $line-height * 1.5; // 36px/2.25em
}
h2 {
@include large;
}
.em {
line-height: 1em;
}
h1 {
/* 42px / 48px */
font-size: 2.625em;
line-height: 3em;
}
h2 {
/* 26 / 36px */
font-size: 1.625em;
line-height: 2.25em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment