Sass @warn Rules

Last Updated:

Sass @warn Rules

When writing @function and @mixin that takes a dynamically generated value as an argument, you usually want to discourage users from passing certain arguments, but do not want to stop the execution.

In the following example, @warn will throw a warning when the parameter value is greater than 10, but it will not stop executing further.

Example

SASS TO CSS CONVERTER
@function myFunction($x){ @if $x > 10{ // Check your console @warn "$x value is too great"; } $result: $x * 2; @return $result; } footer ul{ font-size: myFunction(12) * 1px; }

Syntax

@warn "warning message";

Share this Page

Meet the Author