Home » SASS error Directive

SASS error Directive

by Online Tutorials Library

Sass @error Directive

Sass @error directive is used when you want to display errors. It displays the SassScript expression values as fatal error including a nice stack trace.


Sass @error Directive Example

Let’s create a SCSS file named “error.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 error.scss:error.css

It will create a normal CSS file named “error.css” in the same directory automatically.

Error-directive1

Output:

Error-directive2

You may also like