Suppose i have a variable:
$var: 5px;
but somewhere in code its value have changed in to possible color, number
To be a little clearer, here's how you might use type-of:
@if type-of($my-variable) == string {
/* do something */
}
In addition to the types shown in the docs, type-of will also return 'map' if passed a SASS map object:
$font-sizes: (
small: rem-calc(18px),
medium: rem-calc(20px),
large: rem-calc(22px)
);
@if type-of($font-sizes) == map {
/* do map-related thing */
} @else {
/* do other thing */
}