Sass global-variable-exists() Function

Last Updated:

Sass global-variable-exists() Function

The global-variable-exists() function returns whether a global variable named $name (without the $) exists.

Example

SASS TO CSS CONVERTER
//Check your console @debug global-variable-exists("var1"); // false $var1: '#8c8c8c'; @debug global-variable-exists("var1"); // true p{ // $var2 is local. $var2: 'red'; @debug global-variable-exists("var2"); // false }

Syntax

global-variable-exists($name)

Parameter Value

ValueTypeExplanation
$name Required Specifies the name of the global variable.

Return Value

ValueExplanation
bool Returns whether a global variable named $name (without the $) exists.

Share this Page

Meet the Author