Skip to content

Instantly share code, notes, and snippets.

@alexwelch
Created September 15, 2010 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexwelch/581510 to your computer and use it in GitHub Desktop.
Save alexwelch/581510 to your computer and use it in GitHub Desktop.
def browser_scoped_container(el='body', options={}, &block)
namespace = 'browser_'
html = "<!--[if lt IE 7 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie6"))}><![endif]-->"
html += "<!--[if IE 7 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie7"))}><![endif]-->"
html += "<!--[if IE 8 ]><#{el} #{tag_options(options.merge(:class => "#{namespace}ie8"))}><![endif]-->"
html += "<!--[if (gt IE 9)|!(IE)]><!--><#{el} #{tag_options(options.merge(:class => "#{namespace}non_ie"))}><!--<![endif]-->"
html += capture(&block)
html += "</#{el}>"
html
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment