Last active
August 29, 2015 14:07
-
-
Save alexmccabe/c3ad39254057c5e90909 to your computer and use it in GitHub Desktop.
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
/** | |
* Checking whether a number has the correct unit | |
* @var $number [number] The number (with the unit) that you want to check against. E.g 35px | |
* @var $unit [string] The unit that you need to know exists. E.g 'px' | |
* @return [boolean] | |
*/ | |
@function check-unit($number, $unit) { | |
@if $number != '' and unit($number) == $unit { | |
@return true; | |
} @else { | |
@return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment