Skip to content

Instantly share code, notes, and snippets.

@scottkellum
Created August 6, 2011 13:30
Show Gist options
  • Save scottkellum/1129334 to your computer and use it in GitHub Desktop.
Save scottkellum/1129334 to your computer and use it in GitHub Desktop.
Modular scale in Sass.
$golden: 1.618
$thirds: 3 / 2
$fourths: 4 / 3
=modular-scale($attribute, $value, $ratio, $multiple)
$modular-scale: $value
@for $i from 1 through $multiple
$modular-scale: $modular-scale * $ratio
#{$attribute}: $modular-scale
.foo
+modular-scale(width, 12px, $golden, 6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment