In this brief article a want to give you some reasons why you should stop writing CSS and start writing SASS.
At the end the output is the same a cool and well minified .css file.
The order of the list isn't important!
When you write SASS code you will see the difference instantly when you see that the code is a lot cleaner without brackets and semicolons, that matters here are tabs.
When you write nested selectors you will have an easier time watch this 😁️
That thing was really needed in CSS... the use of variables that will help you a lot to manage your code and even for future refactoring.
For example you can create a palette.sass file and store all your colors and then call that variable inside your buttons or divs...
The most beautiful thing in my opinion is that just changing one line of code (where you have defined the color variable) you can change the color of your entire application.
Really cool stuff, mixins help you to define reusable portions of code, you can think of them like functions, you can pass a parameter and get back you block dynamically written
mmm.. yes mixins and functions are really similar... but, but with functions you can return something with mixins you have only a predefined block of code
Instead of having a super big main.css file with 200000 lines of code split by strange ### signs with titles or worst stuff you could import and export you sass files.
It is not the same thing as the link rel thing cause when you do that you are making an HTTP request :D
You will have a beautiful structure of your code for example with
You can even import CSS files!!
With sass you can do pretty any operation you want, that was a big limitation with only css, now no more!
Another thing missing in CSS is the logic, with SASS you have the possibility to use if statements, for while.
That will help you to write less code with more ease.
Maybe i have said it a lot of times but really, with SASS you will see a beautiful code.
Using the combination of mixins imports variables no way that is like css, you code will be really clear to understand.
The only fact that you have different files that contains different parts of you code it will help you when you want to change something in the future.
For example image that you want to change the main color with css... or the font family
Clean code means fast development, one of the things that IMHO slowed me a lot was semicolons, and another thing... semicolons, i really hated semicolons...
You can use mixins without having to repeat over and over parts of code respecting the dry principle.
You will get as output a clean css file the way that you want, if you want multiple css files is up to you.
You CSS will be minimized and ready to be imported...
I hope that you enjoyed this article, it is my first article, i hope that that stuff my help someone and thanks for reading...
Let me know if you want to know how to install SASS with a youtube video or things like that...
If you enjoyed my style check out my new Youtube Channel
Thank you for your time, have a good day 👋😁