Connor
Connor

Reputation: 4168

Add compass to existing sass project?

I've got an existing project that uses vanilla SASS, and I'd like to add Compass to it. I've used Compass in the past, but have only used it with the compass create command.

I'm looking for a way to be able to utilize the power of compass by just importing the SCSS files that are associated with it, and not having to abide by the structure it gives.

How can I do this?

Upvotes: 6

Views: 9302

Answers (2)

CodyBugstein
CodyBugstein

Reputation: 23302

According to Compass Documentation you can use

compass init rails path/to/project [--using blueprint]

Upvotes: 1

Miriam Suzanne
Miriam Suzanne

Reputation: 14010

All you need for compass on a stand-alone project is the gem and config.rb. I copy/paste the config file from one project to another and then adjust settings such as plugin requirements and file structure. You can use any structure you like, as long as you set it up in the config file.

Here's an example from one of my current projects:

# Compass CSS framework config file

require 'susy'
require 'modular-scale'
require 'sassy-buttons'
require 'breakpoint'
require 'compass-css-arrow'
require 'rgbapng'
# Require any additional compass plugins here.

project_type = :stand_alone
# Set this to the root of your project when deployed:
http_path = "/"
sass_dir = "sass"
css_dir = "static/css"
images_dir = "static/images"
fonts_dir = "static/fonts"
javascripts_dir = "static/js"
line_comments = false
preferred_syntax = :scss
output_style = :expanded
relative_assets = true

Upvotes: 12

Related Questions