Sass feature-exists() Function

Last Updated:

Sass feature-exists() Function

The feature-exists() function returns whether the current Sass implementation supports $feature.

Note: The $feature must be a string.

Example

SASS TO CSS CONVERTER
//Check your console @debug feature-exists("at-error"); // true @debug feature-exists("unrecognized"); // false

Syntax

feature-exists($feature)

Parameter Value

ValueTypeExplanation
$feature Required Specifies a string. The following are the list of possible values
  • at-error - which means that the @error rule is supported.
  • custom-property - which means that custom property declaration values don’t support any expressions other than interpolation.
  • extend-selector-pseudoclass - which means that the @extend rule will affect selectors nested in pseudo-classes like :not().
  • global-variable-shadowing - which means that a local variable will shadow a global variable unless it has the !global flag.
  • units-level3 - which means that unit arithmetic supports units defined in CSS Values and Units Level 3.

Return Value

ValueExplanation
true Returns true for any recognized $feature.
false Returns false for any unrecognized $feature.

Share this Page

Meet the Author