def generate_css(source, source_dir = '')
full_file_path = Dir[File.join(@src_dir, 'stylesheets', source_dir, "#{source}.{sass,scss}")].first
if full_file_path && File.exist?(full_file_path)
begin
sass_options = { :load_paths => [ File.join(@src_dir, 'stylesheets') ] }.merge(self.configuration.sass_options)
if File.extname(full_file_path) == ".scss"
sass_options[:syntax] = :scss
end
stylesheet = Sass::Engine.new(File.read(full_file_path), sass_options)
stylesheet.to_css
rescue Exception => e
render_rescue_from_error(StaticMatic::TemplateError.new(full_file_path, e))
end
else
raise StaticMatic::Error.new("", source, "Stylesheet not found")
end
end