Skip to main content

type-of ()

Returns the type of the given value.

In addition to the native Sass types, regex will be returned when the given value is a regular expression.

Parameters

$value
The value from which to get a type.
Type
*

Return Value

String
Returns an unquoted string describing the type of value given.

Example

@use '@sass-fairy/meta';

@debug meta.type-of(20px);
// number

@debug meta.type-of(20px 40px 80px);
// list

@debug meta.type-of(REGEX 'ab+c');
// regex