def css_include_tag(*stylesheets)
options = stylesheets.last.is_a?(Hash) ? stylesheets.pop : {}
return nil if stylesheets.empty?
css_prefix = options[:prefix] || Merb::Plugins.config[:asset_helpers][:css_prefix]
css_suffix = options[:suffix] || Merb::Plugins.config[:asset_helpers][:css_suffix]
if (bundle_name = options[:bundle]) && Merb::Assets.bundle? && stylesheets.size > 1
bundler = Merb::Assets::StylesheetAssetBundler.new(bundle_name, *stylesheets)
bundled_asset = bundler.bundle!
return css_include_tag(bundled_asset)
end
tags = ""
reload = options.delete(:reload)
timestamp = options.delete(:timestamp)
for stylesheet in stylesheets
href = css_prefix.to_s + asset_path(:stylesheet, stylesheet)
if css_suffix
ext_length = ASSET_FILE_EXTENSIONS[:stylesheet].length + 1
href.insert(-ext_length,css_suffix)
end
href = append_query_string(href, reload, timestamp)
attrs = {
:href => href,
:type => "text/css",
:rel => "Stylesheet",
:charset => options[:charset] || "utf-8",
:media => options[:media] || :all
}
tags << %Q{<link #{attrs.to_xml_attributes} />}
end
return tags
end