Created
February 14, 2012 16:22
-
-
Save davidyeiser/1827887 to your computer and use it in GitHub Desktop.
Sass mixin for automatically determining modular scale font-size value
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
$font-size-base: 16px; | |
$font-size-minor: 10px; | |
@mixin font-size($scale: 1) { | |
font-size: round( | |
($font-size-base * ((exp(1.618, $scale) - exp(-0.618, $scale)) / 2.236)) + | |
($font-size-minor * ((exp(1.618, ($scale - 1)) - exp(-0.618, ($scale - 1))) / 2.236)) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment