Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 423
Connor Avatar asked Sep 20 '12 00:09

Connor


People also ask

What is Compass in Sass?

Compass. SASS. Definition. Compass is an SASS library holding the raw code with additional inbuilt functions. SASS is merely and extension of CSS3 which includes variables, loops, selector inheritance and many more.

How do I add Sass to my project?

First, download and install Microsoft's VS Code editor if you haven't already. Then launch the editor so you can download the Live Sass Compiler extension. And that's all you have to do. Once the installation is done, you'll be able to use Sass in your projects.


2 Answers

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
like image 183
Miriam Suzanne Avatar answered Nov 11 '22 08:11

Miriam Suzanne


According to Compass Documentation you can use

compass init rails path/to/project [--using blueprint]
like image 25
CodyBugstein Avatar answered Nov 11 '22 08:11

CodyBugstein