Skip to content

Instantly share code, notes, and snippets.

@surreymagpie
Created November 13, 2014 20:58
Show Gist options
  • Save surreymagpie/ddbc9581cd56b03fa41d to your computer and use it in GitHub Desktop.
Save surreymagpie/ddbc9581cd56b03fa41d to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
$ratio: 1.32;
$base-font-size: 16px;
$base-line-height: 1.5;
$line: $base-font-size * $base-line-height;
@function rem($px) {
@return $px / $base-font-size * 1rem;
}
@function lines($px){
$line-height: ceil($px / $line) * $line;
@return $line-height / $px;
}
@mixin font-size($px){
font-size: $px;
font-size: rem($px);
}
%header {
font-family: sans-serif;
color: #333;
margin: $base-line-height * 1rem 0;
}
body {
margin: 0;
-webkit-background-size: 100% 3rem;
background-size: 100% 3rem;
background-image: linear-gradient(to bottom, #fff, #fff 50%, #ccc 50%, #ccc);
}
@for $heading from 1 through 6 {
$calc-size: round($base-font-size * pow($ratio, 5 - $heading));
h#{$heading} {
@extend %header;
@include font-size($calc-size);
line-height: lines($calc-size);
}
}
p {
font-size: $base-font-size;
line-height: $base-line-height;
margin-bottom: $line;
}
h1, h2, h3, h4, h5, h6 {
font-family: sans-serif;
color: #333;
margin: 1.5rem 0;
}
body {
margin: 0;
-webkit-background-size: 100% 3rem;
background-size: 100% 3rem;
background-image: linear-gradient(to bottom, #fff, #fff 50%, #ccc 50%, #ccc);
}
h1 {
font-size: 49px;
font-size: 3.0625rem;
line-height: 1.46939;
}
h2 {
font-size: 37px;
font-size: 2.3125rem;
line-height: 1.2973;
}
h3 {
font-size: 28px;
font-size: 1.75rem;
line-height: 1.71429;
}
h4 {
font-size: 21px;
font-size: 1.3125rem;
line-height: 1.14286;
}
h5 {
font-size: 16px;
font-size: 1rem;
line-height: 1.5;
}
h6 {
font-size: 12px;
font-size: 0.75rem;
line-height: 2;
}
p {
font-size: 16px;
line-height: 1.5;
margin-bottom: 24px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment