The introspection function I’ve found most useful is variable-exists(), which returns whether a variable exists in the current scope. With this function, we can check for a variable in our project, then instruct Sass to do something if the variable exists.
view source