How to install Sass on Linux - Ubuntu 18.04 / 20.04

Sass has become a popular CSS pre-processor nowadays used often in many small to large scale web development projects.

Just in case you are new to Sass, it stands for Syntactically Awesome Stylesheet and its works perfectly as the name suggests. It reduces the repetition of css and hence can save you a lot of time for larger projects.

See what Sass website has to say about this:

CSS on its own can be fun, but stylesheets are getting larger, more complex, and harder to maintain. This is where a preprocessor can help. Sass has features that don't exist in CSS yet like nesting, mixins, inheritance, and other nifty goodies that help you write robust, maintainable CSS.

Wow, robust and maintainable CSS, cool!

Excited? So just let us quickly come to the installation process of this awesome CSS Preprocessor.

Note: same method can be used on all Linux based OS, unless specified otherwise.

Installation Process

First of all download and save the Sass file from Sass Github. Please note to keep track of where you saved the file. Once saved, visit the path where you saved the compressed file and extract it.

Extract the file

For instance, here the file is saved and extracted to the same directory where it was saved after downloading.

Change current directory to dart-sass file Once extracted, move to the dart-sass directory inside it like above, and type & hit the following command

sudo cp sass /usr/local/bin

Copy the Sass

Here cp copies the file named sass to /usr/local/bin which is used to store the local program files in Linux. Now you just need to type sass to access it from anywhere you like.

Result on typing sass command

Congratulations! you have now successfully installed Sass.

If you are new to Sass, Sass guide is the perfect place to get started. If this has helped you, please follow me on my Twitter handle, which I have just recently started to update regularly ;)

Thanks & Happy Coding :)