What Is Warn Error and Debug Rule in Saas?

SaaS Is a CSS Preprocessor Used To Help Write CSS More Efficiently and With Less Work. Today We Will Learn Three Important Rules of SaaS.

Previously I have written about Saas Variable which you can read to better understand Saas Variable. Also I wrote an article about on Saas Import rule. T

Today we will learn three important rules in SaaS. Let’s dig into them.

Debug rule

It’s like console.log in JavaScript. You can print any value of a variable or expression through @debug. Let’s see an example.

Example :

Style.scss

We are printing the variable color and expression at a time in the console through debug

Warn Rule

NO one can write perfect code. So sometimes you need to remind yourself or users what kind of code you can write. This rules gives some form of validation. Form official doucementatio we know htat

“When writing mixins and functions, you may want to discourage users from passing certain arguments or certain values. They may be passing legacy arguments that are now deprecated, or they may be calling your API in a way that’s not quite optimal”

But this rule doesn’t stop code from runnig, it jsut shows a warning .

Example:

Look at the above code. I made a function to test whether the value is right or wrong.Whenever i gave value less than 16 , i can see a warning in the cosole which tells me to input value larger than 16. The task of @warning is to give us warning in the code.

Error rule:

It is similiar as Warn RUle. But there is a diffenrtece. IF we use warn , it won’t stop code from running. But while using error, the code won’t run, instead it will give an error.

Thanks for reading my article. Follow me for more future articles.

Front-End Developer & Tech Writer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store