Hie everyone !
My Sass project looks like this :
Project
├── sass/
│ ├── bootstrap/
│ │ ├── ...
│ │ ├── _bootstrap.scss
│ ├── mymodule/
│ │ ├── submodules/
│ │ ├── _mymodule.scss /*with only @import from submodules/ */
| └── main.scss /* various styles & @import bootstrap, mymodule */
└── stylesheets/
└── main.css
I'm trying to watch every modifications:
And alterate only stylesheets/main.css with modifications i made.
Every commands I wrote have generate mymodule.css or others scss files/folders.
What is the sass --watch for doing this please ?
Thanks a lot in advance !
Alexis
You should totally use Compass!
Compass is a must-have tool for every SASS coder. Compass consists of two parts:
The compass watch
command is exactly what you're looking for. It will recompile the CSS whenever you save a change in any of the following:
sass
folder (in your case it's only main.scss
);Partials that are never imported are ignored.
Compass will create a separate CSS file for every non-partial file. As for partials, they do not appear as separate CSS files because are incorporated inside non-partials.
For the following to work, you must have Ruby and RubyGems. Probably you already have them.
To start using Compass, do:
gem install compass
.compass.rb
file in the root of your project (in your case it's Project/compass.rb
).compass watch
and start coding.Here's a minimal compass.rb
that might work for you:
css_dir = "stylesheets"
sass_dir = "sass"