Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run SASS without installing?

Tags:

sass

I wanted to use SASS on our company's web app but I can't install any programs on production machines. Everything I searched about SASS required you to run an installation program like gem and also required HAML.

I was hoping to find just a script that processes scss files without needing to install anything else.

like image 311
Juan Mendes Avatar asked Nov 12 '10 17:11

Juan Mendes


People also ask

Does Sass need to be installed?

No, Sass doesn't need to be installed on the server. It only needs to be installed locally, as the Sass is converted to CSS, and it's the CSS file (not the Sass file) that is uploaded to the live server. Web browsers don't actually know how to interpret Sass, so there is no need for the server to have it.


2 Answers

Well... if you have Ruby available, you could checkout the Git repository of Sass (https://github.com/nex3/sass). Do so by either typing git clone https://github.com/nex3/sass.git or just downloading it.

Then you could use the interactive Ruby console by typing irb. Try to require 'sass/lib/sass' (this one here) and run Sass.compile_file 'my_styles.css'.

Otherwise... why are you trying to do that? You can also install sass locally, run sass --watch on your sass folder and it compiles your scss files automatically into css files - which you can deploy on your production environment.

like image 80
crispy Avatar answered Oct 12 '22 07:10

crispy


If you can run java program in your build system, you could use JRuby for compiling sass. See this answer for more details

like image 27
Joep Avatar answered Oct 12 '22 08:10

Joep