Sass @warn Rules

You are Here:

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";

Reminder

Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in Sass.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author