Sass type-of() Function
You are Here:
Sass type-of() Function
The type-of()
function returns the type of $value.
Example
SASS TO CSS CONVERTER
// Check your console
$font-weights: ("regular": 400, "medium": 500, "bold": 700);
@function foo($x) { @return $x; }
@mixin syntax-colors($args...) {
@debug type-of($args);
}
@debug type-of(10px); // number
@debug type-of("#8c8c8c"); // string
@debug type-of(#8c8c8c); // color
@debug type-of(true); // bool
@debug type-of(null); // null
@debug type-of(10px 20px 30px); // list
@debug type-of($font-weights); // map
@debug type-of(get-function(foo)); // function
@include syntax-colors(
$string: #080, // arglist
$comment: #800,
)
Syntax
type-of($value)
Parameter Value
Value | Type | Explanation |
---|---|---|
$value | Required | Specifies a value for which the type needs to be found. |
Return Value
Value | Explanation |
---|---|
value | Returns the type of $value. The following are the list of possible values.
|
Reminder
Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Sass.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.