def define_callback(name)
      class_eval <<RUBY, __FILE__, __LINE__ + 1
def on_#{name}(&block)
  @_sass_callbacks = {} unless defined? @_sass_callbacks
  (@_sass_callbacks[#{name.inspect}] ||= []) << block
end

def run_#{name}(*args)
  return unless defined? @_sass_callbacks
  return unless @_sass_callbacks[#{name.inspect}]
  @_sass_callbacks[#{name.inspect}].each {|c| c[*args]}
end
private :run_#{name}
RUBY
    end
def define_callback(name)
      class_eval <<RUBY, __FILE__, __LINE__ + 1
def on_#{name}(&block)
  @_sass_callbacks = {} unless defined? @_sass_callbacks
  (@_sass_callbacks[#{name.inspect}] ||= []) << block
end

def run_#{name}(*args)
  return unless defined? @_sass_callbacks
  return unless @_sass_callbacks[#{name.inspect}]
  @_sass_callbacks[#{name.inspect}].each {|c| c[*args]}
end
private :run_#{name}
RUBY
    end
Define a callback with the given name.
 This will define an `on_#{name}` method
 that registers a block,
 and a `run_#{name}` method that runs that block
 (optionall with some arguments).

 @param name [Symbol] The name of the callback
 @return [void]