Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Sass Introspection Functions


Sass Introspection Functions

The introspection functions are rarely used when building a stylesheet. However, they are valuable if something does not work properly - to figure out what's going on: like debugging functions.

The following table lists all introspection functions in Sass:

Function Description & Example
call(function, arguments...) Calls a function with arguments, and returns the result.
content-exists() Checks whether the current mixin was passed a @content block.
feature-exists(feature) Checks whether feature is supported by the current Sass implementation.

Example:
feature-exists("at-error");
Result: true
function-exists(functionname) Checks whether the specified function exists.

Example:
function-exists("nonsense")
Result: false
get-function(functionname, css: false) Returns the specified function. If css is true, it returns a plain CSS function instead.
global-variable-exists(variablename) Checks whether the specified global variable exists.

Example:
variable-exists(a)
Result: true
inspect(value) Returns a string representation of value.
mixin-exists(mixinname) Checks whether the specified mixin exists.

Example:
mixin-exists("important-text")
Result: true
type-of(value) Returns the type of value. Can be number, string, color, list, map, bool, null, function, arglist.

Example:
type-of(15px)
Result: number
type-of(#ff0000)
Result: color
unit(number) Returns the unit associated with a number.

Example:
unit(15px)
Result: px
unitless(number) Checks whether the specified number has a unit associated with it.

Example:
unitless(15px)
Result: false
unitless(15)
Result: true
variable-exists(variablename) Checks whether the specified variable exists in the current scope.

Example:
variable-exists(b)
Result: true

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.