Skip to content
Adds more functionality to Haml and Sass (part of BigBand).
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib fix typo Jul 19, 2010
spec/sass specs Feb 18, 2010
vendor updated coffee-script Feb 25, 2010
.gitmodules add :coffee_script Feb 24, 2010
LICENSE added license May 2, 2010 note about usage with erb. Jun 9, 2010

Haml::More and Sass::More

Adds more functionality to Haml and Sass. Haml helpers detect if called from another context, so they are usable with Erb and friends.


Haml::More and Sass::More are part of the BigBand stack. Check it out if you are looking for fancy Sinatra extensions.

Haml extensions

  • content_for and yield_content (like in Rails, you know?)

    // some_file.haml
    = yield_content(:foo)
      = haml :another_file
    // another_file.haml
    - content_for(:foo)
      %b bar
      %h1 cool, huh?
  • adds :coffee_script for inline CoffeeScript

      %title CoffeScript example
        if happy and knows_it

SassScript extensions

  • min and max

      width = max(100px, !someSize * 3)
      height = min(!a, !b, 20%)

Usage with Sinatra

Classic style:

require "sinatra"
require "haml/more"


require "sinatra/base"
require "haml/more"

class Foo < Sinatra::Base
  helpers Haml::More

Usage without Sinatra

Using just Sass::More (if you're in Merb or Rails):

# in some initializer or something
require "sass/more"

Without anything:

require "haml/more"
scope =
scope.extend Haml::More
puts"%p some haml code").render(scope)
Something went wrong with that request. Please try again.