Skip to content

Instantly share code, notes, and snippets.

@davidyeiser
Created February 14, 2012 16:22
Show Gist options
  • Save davidyeiser/1827887 to your computer and use it in GitHub Desktop.
Save davidyeiser/1827887 to your computer and use it in GitHub Desktop.
Sass mixin for automatically determining modular scale font-size value
$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