sass – tworzenie projektu

W katalogu projektu (project/webroot) utwórz plik konfiguracyjny

# cd my_projekt/
# compass create --bare 
                 --sass-dir 'sass' --css-dir 'css' --images-dir 'img' 
                 --javascripts-dir 'js' --fonts-dir 'fonts'
Congratulations! Your compass project has been created.
You may now add sass stylesheets to the sass subdirectory of your project.
Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.
You can configure your project by editing the config.rb configuration file.

You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]
# cat config.rb

require 'compass/import-once/activate'

http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
javascripts_dir = "js"
fonts_dir = "fonts"

# You can select your preferred output style here (can be overridden via the command line):
# output_style = :expanded or :nested or :compact or :compressed
output_style = :compressed

# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false


# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass

Nie generujemy standardowych katalogów (img, js, css), które mogą już istnieć lub tworzymy je ręcznie

# ls -al
 
 config.rb    - główny plik konfiguracyjny
 sass/        - pusty katalog utworzony (opcja --bare)

Z poziomu katalogu projektów (nadrzędnego) podaj nazwę projektu i katalog publiczny w którym są katalogi i plik konfiguracyjny

# compass compile my_project/webroot

# compass watch my_project/webroot     - automatyczna kompilacja
lub
# cd my_project/webroot
# compass watch