If you want to streamline your SCSS or SASS setup, consider creating a dedicated file where all partials are imported.
For instance, create a new SASS file within your sass directory and name it something like app.sass
.
In this app.sass
file, import all your partials using the syntax:
@import 'partials/button-actions'
Next, set up a config.rb
in the directory where your watcher is running from (preferably the project root directory).
In the config.rb
file, include the following:
require 'compass/import-once/activate'
# Include any additional compass plugins here.
# Define the project's root when deployed:
# Modify paths accordingly. css_dir represents the output CSS directory, while sass_dir is for the SASS files
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "i"
javascripts_dir = "js"
# Choose your preferred output style (can be overridden via command line):
# output_style = :expanded or :nested or :compact or :compressed
output_style = :compressed
# Enable relative paths to assets through compass helper functions by uncommenting:
# relative_assets = true
# Disable debugging comments that indicate selectors' original locations by uncommenting:
# line_comments = false
# If using indented syntax, regenerate the project passing --syntax sass, or uncomment the following:
preferred_syntax = :sass
# then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
Initiate the watcher to generate an app.css
file with all code from imported files consolidated. Simply include this in your HTML.