MENU
Introspection
| feature-exists($feature) | Returns whether a feature exists in the current Sass runtime. |
| variable-exists($name) | Returns whether a variable with the given name exists in the current scope. |
| global-variable-exists($name) | Returns whether a variable with the given name exists in the global scope. |
| function-exists($name) | Returns whether a function with the given name exists. |
| mixin-exists($name) | Returns whether a mixin with the given name exists. |
| inspect($value) | Returns the string representation of a value as it would be represented in Sass. |
| type-of($value) | Returns the type of a value |
| unit($number) | Returns the unit(s) associated with a number. |
| unitless($number) | Returns whether a number has units. |
| comparable($number1, $number2) | Returns whether two numbers can be added, subtracted, or compared. |
| call($name, $args…) | Dynamically calls a Sass function. |
There are 4 features in Sass.
.a { width: if(feature-exists(global-variable-shadowing), 100px, 200px); }
.b { width: if(feature-exists(extend-selector-pseudoclass), 100px, 200px); }
.c { width: if(feature-exists(units-level-3), 100px, 200px); }
.d { width: if(feature-exists(at-error), 100px, 200px); }
.e:after {content: type-of(#300 2px);}.a {
width: 100px;
}
.b {
width: 100px;
}
.c {
width: 100px;
}
.d {
width: 100px;
}
.e:after {
content: list;
}