Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

How to use SASS with Netbeans 8.0.1

I'm trying to use SASS in Netbeans 8.0.1. I have Ruby and SASS set up correctly based upon the feedback from ruby -v.

I have a web application set up with css and scss folders under ProjectWeb Pages esources.

My input and output are set to /scss and /css respectively and I have checked 'Compile Sass File on Save'. I have created a styles.scss file and added some SASS/CSS.

When I save the styles.scss file, is it supposed to generate a styles.css? Nothing happens when I save or compile the project.

Has anyone run into any similar problems or have suggestions on how to debug this problem?

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Installing SASS on Windows10, Ruby2.2.3, Netbeans8

  1. Download SASS for Windows - RubyInstaller.org
  2. Install Ruby like:

Installing SASS in Netbeans

  1. Search windows for CMD (Command Prompt) and start it.
  2. Access Ruby's bin folder using cd Rubyin (Hit Enter)
  3. Install sass using the command gem install sass (Hit Enter to install)

Installing SASS in Netbeans

  1. Wait for the installation to finish

Installing SASS in Netbeans

  1. In Netbeans open
    Options → Tools → Miscellaneous (HTML/JS in v8.1+) → CSS Preprocessors tab
  2. Enter the path to the installed sass.bat C:Rubyinsass.bat than click Install Sass.
    Confirm your changes with Apply / OK

Installing SASS in Netbeans

  1. Use an existing one or Create a New Project (HTML5, PHP, whatever...).
    After the project is created open the Projects window.
    Right-Click your project and choose > Properties.
    From the Project Properties popup select CSS Preprocessors.
    Select the Compile SASS Files on Save.
    (If you want the compiler to automatically minimize your .css result file, use --style compressed under the Compiler Options)

Installing SASS in Netbeans

  1. You can see from the image above that the compiler uses two default Input(watchable)/Output(compiled destionation) folders paths.
    Create the scss folder (an optionally the css folder) in your project as well.

Installing SASS in Netbeans

You're done!

As soon you create a new .scss file or you save it Netbeans will automatically compile the file to .css in the /css folder.

Installing SASS in Netbeans


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...