Sass unitless() Function

Last Updated:

Sass unitless() Function

The unitless() function returns whether a given number has a unit.

Example

SASS TO CSS CONVERTER
//Check your console @debug unitless(50); // true @debug unitless(50px); // false

Syntax

unitless($x)

Parameter Value

ValueTypeExplanation
$x Required A number (with or without unit).

Return Value

ValueExplanation
Number Returns whether $x has no units

Share this Page

Meet the Author