merch89 merch89 - 4 months ago 7x
CSS Question

Enabling SASS on a basic HTML/CSS site

Want to take my first look at SASS. How can I convert a basic CSS into SASS, is it just a case of adjusting my link and then transferring to a .sass extension. Then editing the SASS content?

Just got a simple HTML/CSS site to do some testing.
Do I need Ruby or any extra server config to get SASS setup?


You are going to want to install sass first! If you are on a mac, enter the following to the terminal:

sudo gem install sass

When you have installed it, go to your project folder (in the terminal), and create a file with the .scss extension.

Then, in the terminal, enter the following:

sass --watch styles.scss:styles.css 

(styles.scss being the name of your scss/sass file, whatever you named it).

What this does is that it saves all your sass code that you have in your .scss file into a normal .css file. Then in your html, link up it to use the .css file, not the .scss file. (as the .css file has everything you had in your .scss file, but converted to a format it can read).

Hope that helps!