Sass stands for syntactically awesome style sheets. It is a css preprocessor which is used to avoid repetition with css and save time. It allows us to add variables, nested rules, mixins, inline imports, partial files, inheritance and more.
You can write css easily and fast, and they are easy to maintain.
It is a preprocessing language which provides its syntax for css
It is a superset of css which contains all the features of CSS and is an open source pre processor
It is more powerful and stable css extension and style documents more clearly and structurally
It has reusability methods, logic statements and some of the built-in functions like color manipulation, mathematics, and parameter lists item.
We can use SASS in three different ways:
A variable begins with $ sign and the assignment of the variable is completed with a semicolon.
sass contains two types of syntax.
Scss is the first syntax and it uses the extension of .scss which is very easy to write. Scss resembles more to CSS. Any CSS valid document can be converted to sass by simply changing the extension from CSS to SCSS.
Indented syntax or Sass is the other syntax and it uses the extension of .sass where you write the syntax without curly braces and semicolons which is confusing.
The mixin function is used to define styles. Functions and Mixins are very similar. You can re use this style throughout the style sheet. You can reuse it by passing multiple values or parameters and call function to avoid writing repetitive codes.
@debug directive is used to detect the errors and display the sass script expressions values to the standard error output stream.
Extends the css import rule by enabling import of scss and sass files.
All imported files are merged into a single outputted css file.
The SASS @extend directive is used to share a set of css properties from once selector to another. It is very important and useful feature of SASS. It allows a class to share a set of properties with one another. @extend prevents code bloat by grouping selectors that share the same style into one rule.
Interpolation of variable names is not possible in SASS. However you may use interpolation of placeholders.
The SASS @media directive is ued to set style rules to different media types. It supports and extends the @media rules.
The SASS @at-root directive is a collection of nested rules that are used to style block at the root of the document.