SASS is more powerful and stable that provides power to the basic language by using extension of CSS. You can use SASS in three different ways −
1.As a command line tool
2.As a Ruby module
3.As a plugin for Rack enable framework
Using a CSS preprocessor like Sass (Syntactically awesome style sheets) effectively will help modularize your CSS code making it more maintainable, understandable and reusable. Sass consists of two syntaxes, the original syntax called “the indented syntax” and the newer “SCSS”.
How Does SASS Work?
A browser does not understand Sass code. Therefore, you will need a Sass pre-processor to convert Sass code into standard CSS.
This process is called transpiling. So, you need to give a transpiler (some kind of program) some Sass code and then get some CSS code back.
Mixins and control directives:
Mixins allow creating a group of styles, which are reusable throughout your stylesheet without any need to recreation of non-semantic classes. In CSS, the mixins can store multiple values or parameters and call function; it helps to avoid writing repetitive codes. Mixin names can use underscores and hyphens interchangeably.
Styling based on some conditions or applying the same style many times with variations can be accomplished by using control directives and expressions, which are supported by SassScript. These control directives are advanced options used mainly in mixins. They require considerable flexibility, as they are a part of Compass libraries.
Advantages of SASS:
-It allows writing clean CSS in a programming construct.
-It helps in writing CSS quickly.
-It is a superset of CSS, which helps designers and developers work more efficiently and quickly.
-As Sass is compatible with all versions of CSS, we can use any available CSS libraries.
-It is possible to use nested syntax and useful functions such as color manipulation, mathematics and other values.
Disadvantages of SASS:
-It takes time for a developer to learn new features present in this pre-processor.
-If many people are working on the same site, then should use the same preprocessor. Some people use Sass and some people use CSS to edit the files directly. Therefore, it becomes difficult to work on the site.
-There are chances of losing benefits of browser’s built-in element inspector.
SASS (Syntactically Awesome Stylesheet) is a CSS pre-processor, which helps to reduce repetition with CSS and saves time. It is more stable and powerful CSS extension language that describes the style of document structurally.
Join my weekly Newsletter and subscribe to my weekly podcast, In the Arena.
Thanks for reading
Share via social media