htmlsasscompass-sassmerb

If SASS is part of HAML, why do I need Compass in Merb?


This is a theoretical question as much as a practical one. I just can't wrap my head around how all these technologies mesh...

I have heard various things including:

So my question is: ...WHAT??

I do have SASS working in Merb. I have installed Compass and used the instructions on Chris Eppstein's Github wiki to get it working. But why is Compass needed, and why do many sources seem to think that it is not needed and SASS support is built into HAML or Merb?


Solution

  • "HAML and SASS are included in Merb"

    No, they are separate.

    "SASS is part of HAML"

    Sass and Haml, while technically pretty different libraries, come bundled together. They are both part of the haml gem. So you need to install that gem to use Sass. Note that that doesn't require you to actually use Haml in your application.

    "HAML works in Merb, but to use SASS you need to add the 'merb-haml' dependency"

    It's actually the other way round. You can use Haml in merb by installing the merb-haml gem. This adds Haml-specific merb generators and plugs into merbs templating. Sass however only requires the haml dependency (in config/dependencies.rb) for it to work with merb.

    "You need Compass to run SASS in Merb"

    Not true. Compass is a framework built on top of Sass. It has tons of general purpose functions for CSS styling. But you don't need Compass to use Sass. You can take a look at the docs.