You are here

public static function SassScriptFunctions::unitless in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/script/SassScriptFunctions.php \SassScriptFunctions::unitless()

Inspects the unit of the number, returning a boolean indicating if it is unitless.

Parameters

SassNumber The number to inspect:

Return value

new SassBoolean True if the number is unitless, false if it has units.

Throws

SassScriptFunctionException If $number is not a number

File

phpsass/script/SassScriptFunctions.php, line 686

Class

SassScriptFunctions
SassScript functions class. A collection of functions for use in SassSCript. @package PHamlP @subpackage Sass.script

Code

public static function unitless($number) {
  SassLiteral::assertType($number, 'SassNumber');
  return new SassBoolean($number
    ->isUnitless());
}