Created
April 16, 2017 22:27
-
-
Save eikeco/4b68eb6a5e19afdd92ccb77a438af28f to your computer and use it in GitHub Desktop.
This file contains 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
/** | |
* Strip unit from given value | |
* @param {Number} $value Value to remove unit from | |
* @return {Number} Raw value without unit | |
*/ | |
@function strip-unit($value) { | |
@if type-of($value) == 'number' and not unitless($value) { | |
@return $value / ($value * 0 + 1); | |
} | |
@return $value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment