Skip to content

Instantly share code, notes, and snippets.

@chan-grammer
Last active August 29, 2015 14:06
Show Gist options
  • Save chan-grammer/36268ccdd30827671b7b to your computer and use it in GitHub Desktop.
Save chan-grammer/36268ccdd30827671b7b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.3)
// Compass (v1.0.1)
// Scut (v1.0.1)
// ----
@import "scut";
@mixin header_sizes($multiplier: 1.125, $line-height-multiplier: 1.5, $font-size: 16px, $rel: false, $rhythm: false) {
$headings: ();
$current-font-size: $font-size;
@for $i from 1 through 6 {
@if $i > 1 {
$current-font-size: ceil($current-font-size * $multiplier);
}
$headings: append($headings, $current-font-size);
}
$n: 1;
$heading-size: 0;
$line-height: $line-height-multiplier * $font-size;
$line-height-computed: 0;
@for $i from 6 through 1 {
h#{$n} {
$heading-size: nth($headings, $i);
font-size: $heading-size;
@if $rel {
font-size: scut-rem($heading-size);
}
@if $rhythm {
//line-height: floor($heading-size / $font-size) * $line-height-multiplier * 1rem;
$line-height-computed: ceil($heading-size / $line-height) * $line-height;
@include scut-rem-fallback($line-height-computed, line-height);
@include scut-rem-fallback($line-height, margin-bottom)
}
$n: $n + 1;
}
}
}
@include header_sizes($multiplier: 1.2, $rel: true, $rhythm: true);
/*
* Scut, a collection of Sass utilities
* to ease and improve our implementations of common style-code patterns.
* v1.0.1
* Docs at http://davidtheclark.github.io/scut
*/
h1 {
font-size: 42px;
font-size: 2.625rem;
line-height: 48px;
line-height: 3rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
h2 {
font-size: 35px;
font-size: 2.1875rem;
line-height: 48px;
line-height: 3rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
h3 {
font-size: 29px;
font-size: 1.8125rem;
line-height: 48px;
line-height: 3rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
h4 {
font-size: 24px;
font-size: 1.5rem;
line-height: 24px;
line-height: 1.5rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
h5 {
font-size: 20px;
font-size: 1.25rem;
line-height: 24px;
line-height: 1.5rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
h6 {
font-size: 16px;
font-size: 1rem;
line-height: 24px;
line-height: 1.5rem;
margin-bottom: 24px;
margin-bottom: 1.5rem;
}
@chan-grammer
Copy link
Author

Needs to improve, not yet very well tested.

@chan-grammer
Copy link
Author

Refactor, needs to modularize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment