##Compass gem - getting started ###The Compass gem provides an easy way to compile .scss files into .css ####Since browsers currently only read .css files, .scss must be compiled to raw CSS before it can be viewed on a screen
##Install Compass
- If you have Ruby on your computer, run
$gem install compass
anywhere on the command line - That's it!
##Set up a new project with Compass
$compass create directoryName
- running this command will create a new root directory named directoryName
- directoryName installs with several corresponding .scss and .css files
- To initialize Compass within an existing project, run
$compass init rails directoryName
- Create an .html file, preferrably under the root directory
- Write your Sass in the screen.scss file provided by Compass, above
@import "compass/reset";
##Compile Sass to CSS
- While in your Compass-initiated project, run
$compass watch
, which will track changes to your .scss files
- Any change in screen.scss will automatically be compiled to screen.css, located within your CSS directory
- control C in your terminal when your watch has ended
- To compile Sass to CSS manually, run
$compass compile
whenever you want to compile to CSS
##If your Compass project isn't working for some reason
When I init a Compass project, the href in my stylesheet link tags start with a /
, which stops the stylesheet from linking properly
- Try removing that
/
from your stylesheet<link>
if your Sass isn't compiling