Javatpoint Logo
Javatpoint Logo

Sass @warn Directive

Sass @warn directive is used when you get a problem and want to give a cautionary advice to the users. It displays the value of a SassScript expression to the standard error output stream.

There are two specific differences between @warn and @debug:

  • Warning can be turned off with the --quiet command-line option or the: quiet Sass option.
  • Sass @warn directive provides a printed output along with the message so that the user being warned where the warning is occurred.

Sass @warn Directive Example

Let's create a SCSS file named "warn.scss", having the following data.

Now, open command prompt and run the watch command to tell SASS to watch the file and update the CSS whenever SASS file is changed.

Execute the following code: sass --watch warn.scss:warn.css

It will create a normal CSS file named "warn.css" in the same directory automatically.

Sass Warn directive1


Sass Warn directive2

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA