global_variable_exists

global_variable_exists($name)

Check whether a variable with the given name exists in the global scope (at the top level of the file).

Examples:

$a-false-value: false;
global-variable-exists(a-false-value) => true

.foo {
  $some-var: false;
  @if global-variable-exists(some-var) { /* false, doesn't run */ }
}

Parameters:

  • $name (String) The name of the variable to check. The name should not include the $.

Returns:

  • (Bool) Whether the variable is defined in the global scope.
doc_Sass
2016-11-11 13:09:08
Comments
Leave a Comment

Please login to continue.