Skip to content

Instantly share code, notes, and snippets.

@alexeckermann
Created January 24, 2012 05:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexeckermann/1668265 to your computer and use it in GitHub Desktop.
Save alexeckermann/1668265 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