Skip to content

Instantly share code, notes, and snippets.

@lonekorean
Created July 9, 2016 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lonekorean/940033de0deea56dbff72cf2c0a172cf to your computer and use it in GitHub Desktop.
Save lonekorean/940033de0deea56dbff72cf2c0a172cf to your computer and use it in GitHub Desktop.
Sass hexagon math
// tweak this
$width: 200px;
// automatically computed
$side-length: ($width / 2) / cos(30deg);
$cap-y-scale: tan(30deg);
$cap-height: ($width / 2) * $cap-y-scale;
$cap-unscaled-side-length: $width / sqrt(2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment