Last active
August 29, 2015 14:06
-
-
Save chan-grammer/36268ccdd30827671b7b to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; | |
} |
Refactor, needs to modularize
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needs to improve, not yet very well tested.