Sass content-exists() Function

Last Updated:

Sass content-exists() Function

The content-exists() function returns whether the current mixin was passed a @content block.

Note: It throws an error if called outside of a mixin.

Example

SASS TO CSS CONVERTER
//Check your console @mixin debug-content-exists { @debug content-exists(); @content; } @include debug-content-exists; // false @include debug-content-exists { // true }

Syntax

content-exists()

Return Value

ValueExplanation
bool Returns whether the current mixin was passed a @content block.

Share this Page

Meet the Author