Created
March 19, 2014 19:43
-
-
Save seantunwin/9649694 to your computer and use it in GitHub Desktop.
Sass: Find the middle of a line segment. Useful for when you have multiple elements with defined widths or heights and need to find the mid-point.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //find the middle of a line segment | |
| @function get-middle($values...) { | |
| $result: 0; | |
| @each $value in $values { | |
| $result: ($value / 2) + $result; | |
| } | |
| @return $result; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment