Skip to content

Instantly share code, notes, and snippets.

@timjgleeson
Forked from alexeckermann/golden.scss
Created January 24, 2012 05:57
Show Gist options
  • Save timjgleeson/1668277 to your computer and use it in GitHub Desktop.
Save timjgleeson/1668277 to your computer and use it in GitHub Desktop.
Golden CSS3-POINT-OH
$golden-ratio: 1.61803399; // Everyone's doing it!
@function golden-division($value, $times: 1) {
@for $i from 1 through $times {
$value: $value / $golden-ratio;
}
@return round($value);
}
@function golden-multiple($value, $times: 1) {
@for $i from 1 through $times {
$value: $value * $golden-ratio;
}
@return round($value);
}
// ---
.derp {
width: golden-division($content-width, 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment