Skip to content

Instantly share code, notes, and snippets.

@awhitehouse104
Created September 26, 2016 15:40
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 awhitehouse104/6fdfc6c06bc7b3c11bee4a0f0812f89a to your computer and use it in GitHub Desktop.
Save awhitehouse104/6fdfc6c06bc7b3c11bee4a0f0812f89a to your computer and use it in GitHub Desktop.
Base typography
@mixin define-font($size, $ratio, $margin: true) {
$lineHeight: $size * $ratio;
font-size: $size;
line-height: $lineHeight;
@if ($margin) {
margin-bottom: $lineHeight / 4;
}
}
* {
font-family: Arial, Helvetica, sans-serif;
font-style: normal;
}
p, h6, h5, h4, h3, h2, h1 {
margin: 0;
}
* {
@include define-font(1rem, 1.5, false);
}
p {
@include define-font(1rem, 1.5);
}
h6 {
@include define-font(1.25rem, 1.5);
}
h5 {
@include define-font(1.5rem, 1.5);
}
h4 {
@include define-font(1.75rem, 1.5);
}
h3 {
@include define-font(2rem, 1.25);
}
h2 {
@include define-font(2.5rem, 1.25);
}
h1 {
@include define-font(3rem, 1.25);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment