Goldlilys Media Logo

Intro to Compass and SASS

There are many open source frameworks that are released to make theming simpler. One of the problems that themers / front-end developers usually face is the amount of CSS3 features that many want to use, but not all of the different browsers has the capability of getting it working correctly. Therefore, CSS preprocessors like Compass and SASS makes this possible by having predefined mixins, variables, rules and inheritance that are similar to the concepts of Object Oriented Programming.

With the addition of SASS, CSS block styling are treated like functions in programming.

  • We can define variables that have a specific value that can be used throughout the site. Instead of figuring out what the color for a tag/block/section was, why not create a variable to better remember that color? For example: $blogColor = #FFF9E2; . Isn’t $blogColor easier to remember than the color code?
  • Mixins are a way to combine traits/variables for a particular part of your site. Combine CSS styling in a mixin and if that styling is used by multiple selectors, all you need to do is call the mixin with: @include mixinName;
  • To follow the concept of inheritance in OOP, SASS allows mixins to inherit/borrow styles from its parent mixin without retyping everything again. This saves a lot of theming time.
  • Make sure to read the tutorials for Compass and SASS for more useful info.

Now to actually get these two frameworks working with Drupal or WordPress, here are the steps:

  1. Make sure Ruby is installed on your server (MAMP or WAMP).
  2. Then in the command line, type gem install compass.
  3. In Drupal, cd to the main themes directory for your project.
    • Usually located at /sites/all/themes/projectName/
    • From there, type: compass create projectName
    • This creates a projectName directory with a config.rb file, a sass and stylesheets directory and files.
    • If you are using a subtheme like Omega, and want to keep every stylesheet in the global.css, change the path on the config.rb from stylesheets to css and make sure that all changes to the .scss files are reflected in the .css files located in the css directory.
    • Run Compass: compass watch /path/to/your/themes/directory/. Start adding styles to the .scss files.
  4. In WordPress, the steps are mostly the same as above, except:
    • cd to the child-theme directory at /wp-content/themes/project-child and then type: compass create projectName
    • Move or change the path inside the config.rb file to match your setup.
  5. To make theming even simpler the next time you continue, instead of typing up the entire path to run compass, add:alias projectName='compass watch /path/to/your/themes/directory/'

    in your .bash_profile so that all you will need to do is type projectName in the command line and it will automatically run compass for that project.


  6. Once you’ve setup Compass, you don’t need to setup SASS because it’s already included with it.
fgo
Author Bio

Frances Naty Go is the founder of Goldlilys Media, where she helps mission-driven organizations turn their websites into clear, durable systems that support meaningful work over time. She works with museums, nonprofits, health and wellness brands, higher education, life sciences, travel organizations, and expert-led businesses.

With a background in Computer Science from UC San Diego, Frances brings a thoughtful, strategic approach to building digital experiences that educate, orient, and build trust, without unnecessary complexity.

Categories: * *
15 Warning Signs Your Website Is Holding You Back Cover

15 Warning Signs Your Website Is Holding You Back

The most costly website problems aren’t obvious.

They show up as hesitation, doubt, and missed opportunities.

This checklist helps you see what visitors experience, before they decide whether to trust you.
Still Using Wix or Squarespace? That Might Be Costing You More Than You Think Cover

When Wix or Squarespace No Longer Fits

Template platforms often make sense early on.

Growth is where their limits start to matter.

This guide helps you assess whether your website still supports where you’re headed.

Related Articles

Imagine your website as amasterpiecebuilt for what comes next.

Thoughtful insights for leaders who want their website decisions to support growth, usability, and long-term confidence, without constant rebuilding or second-guessing.
Frances on her cellphone looking right and smiling
performance optimization
create a website masterpiece
Frances Go standing by the Prado with a big smile holding a Michelangelo maroon book and artworks behind her

Let’s talk about fit

Book a short conversation to discuss where you’re headed and whether your website still supports it.
Still Using Wix or Squarespace? That Might Be Costing You More Than You Think Cover

Does your website still fit where you’re headed?

A short guide to help you assess whether your current setup supports what comes next.
15 Warning Signs Your Website Is Holding You Back Cover

See what’s quietly getting in the way

A short checklist to help you identify subtle website issues that affect trust, traffic, and action.

Wait! Before you go...

Not ready to commit yet?
I get it.

Get my free guide:

"15 Warning Signs Your Website Is Holding You Back"