Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i create/convert a css file using sass scss

Tags:

css

sass

I am trying to create a file in sass and link it notepad ++ i have tried looking at videos on how to install it and use sass but they all are on mac.

like image 256
user2970828 Avatar asked Jan 09 '14 09:01

user2970828


2 Answers

If you are a windows fan download Ruby Installer and install it locally.

Go to Start > All Programs > Ruby > Start Command Prompt with Ruby

Then install SASS using gem install sass command.

You should now have installed sass, however you can check using sass -v command.

Now using command prompt change the directory to your sass directory and use following commands

# Convert Sass to SCSS
sass-convert style.sass style.scss

# Convert SCSS to Sass
sass-convert style.scss style.sass

To run Sass from the command line, just use

sass input.scss output.css

You can also tell Sass to watch the file and update the CSS every time the Sass file changes:

sass --watch input.scss:output.css

If you have a directory with many Sass files, you can also tell Sass to watch the entire directory:

sass --watch app/sass:public/stylesheets
like image 160
msapkal Avatar answered Oct 15 '22 19:10

msapkal


you can also use "Npp Exec" extension (F6), with easier way:

use this execute commands to compile xxx.scss, generate & open the new xxx.css file

npp_save 
cmd /c "sass --update $(CURRENT_DIRECTORY)\$(NAME_PART).scss:$(CURRENT_DIRECTORY)\$(NAME_PART).css" 
$(NPP_DIRECTORY)\notepad++.exe $(CURRENT_DIRECTORY)\$(NAME_PART).css 
npp_console 0
like image 38
Almog Avatar answered Oct 15 '22 19:10

Almog