An Introduction to SASS for Beginners
Tags: beginners, tutorial, programming, productivity
Published: 2022-09-02 15:09:57

**SASS** (or Syntactically Awesome Style Sheets) is a tool known as a CSS preprocessor. CSS preprocessors are scripting languages that extend the default capabilities of CSS.

It is a great tool to utilize when you wish to code more maintainable CSS, especially when working with larger codebases.

## Defining CSS Preprocessors
_“A CSS preprocessor is a program that lets you generate CSS from the preprocessor’s own unique syntax. There are many CSS preprocessors to choose from, however most CSS preprocessors will add some features that don’t exist in pure CSS, such as mixin, nesting selector, inheritance selector, and so on. These features make the CSS structure more readable and easier to maintain”_. — [MDN](https://developer.mozilla.org/en-US/).

Once you’re comfortable with CSS, the next natural step is to utilize a preprocessor. The biggest advantage is not having to repeat yourself.

This advantage is known as keeping your CSS **Dry**, which stands for “_Don’t Repeat Yourself_.”

**Note**: If you're new or struggling with CSS, be sure to checkout the [CSS Series](https://dev.to/rembertdesigns/series/18887) where I've compiled a list of written blogs about everything CSS.

## Why use preprocessors?
The primary advantages are as follows:

- Cleaner code thanks to variables and nesting.
- Greater ease of maintenance and organization as we can separate our files into modules.
- Ability to implement logic and calculation in our stylesheets.
- Overall improvement in workflow, which will **save hours of development time!**

Of all the preprocessors, **SASS** is by far the most popular within the developer community in my opinion.

## What is SASS?
**SASS** is a scripting language that provides us with features and tools that regular CSS doesn’t have.

Using SASS we can write more readable, maintainable and reusable code. Think of it as an extension that adds power and elegance to CSS.

It gives us various features such as:

- Variables
- Nesting
- Mixins
- Functions
- Partials & Imports
- Inheritance (Extend functionality)
- Control directives

In other words, SASS helps us organize large stylesheets in a more maintainable way.

And we’ll be looking into all of these features throughout my next series of articles on SASS!

## SCSS or Sass?
In SASS there are **two** different syntaxes: **SCSS** and **Sass**. However after being compiled they generate similar output.

**SCSS** (aka Sassy CSS) is the modern standard. It’s syntax is very similar to CSS in that it uses brackets and semicolons. Even normal CSS is valid in this syntax. The file extension is .scss.

**Sass** is an older syntax that focuses on indentation to separate code blocks and newline characters to separate rules. It has the file extension .sass.

Throughout this series, I will use **SCSS** as it’s the more natural syntax (when we use SCSS we still call it SASS!).

It’s also really easy to convert regular CSS to SCSS, as you can just paste in the CSS and work from there!

**Example of SASS being used in real life projects**:
{% codepen https://codepen.io/rembertdesigns/pen/vYpNPME %}

## Conclusion
If you liked this blog post, follow me on [Twitter](https://twitter.com/RembertDesigns) where I post daily about Tech related things!
![Buy Me A Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijinng8k7bf23v0o6gkj.png) If you enjoyed this article & would like to leave a tip — click [here](https://www.buymeacoffee.com/rembertdesigns)

### 🌎 Let's Connect

- [Portfolio](https://www.rembertdesigns.co/)

- [Twitter](https://twitter.com/RembertDesigns)

- [LinkedIn](https://www.linkedin.com/in/rrembert/)

- [Hashnode](https://rembertdesigns.hashnode.dev/)

- [Devto](https://dev.to/rembertdesigns)

- [Medium](https://medium.com/@rembertdesigns)

- [Github](https://github.com/rembertdesigns)

- [Codepen](https://codepen.io/rembertdesigns)