Last active
February 1, 2018 07:17
-
-
Save droid001/fa86542eaa53849d31321dd7ee4d29b5 to your computer and use it in GitHub Desktop.
Strips unit from number string
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
// From https://css-tricks.com/snippets/sass/strip-unit-function/ | |
@function strip-unit($number) { | |
@if type-of($number) == 'number' and not unitless($number) { | |
@return $number / ($number * 0 + 1); | |
} | |
@return $number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment