Sha256: 4ffed406caf37f67907a961e88c68f9e7ca58d5eb11278638cbb445bfc7c52c7

Contents?: true

Size: 745 Bytes

Versions: 2

Compression:

Stored size: 745 Bytes

Contents

module Speedo
  module LayoutHelper
    
    # Implements the Paul Irish IE conditional comments HTML tag--in HAML.
    # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
    def cc_html(options={}, &blk)
      attrs = options.map { |(k, v)| " #{h k}='#{h v}'" }.join('')
      [ "<!--[if lt IE 7 ]> <html#{attrs} class='ie6'> <![endif]-->",
        "<!--[if IE 7 ]>    <html#{attrs} class='ie7'> <![endif]-->",
        "<!--[if IE 8 ]>    <html#{attrs} class='ie8'> <![endif]-->",
        "<!--[if IE 9 ]>    <html#{attrs} class='ie9'> <![endif]-->",
        "<!--[if (gt IE 9)|!(IE)]><!--> <html#{attrs}> <!--<![endif]-->",
        capture_haml(&blk).strip,
        "</html>"
      ].join("\n")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
speedo-0.0.2 app/helpers/speedo/layout_helper.rb
speedo-0.0.1 app/helpers/speedo/layout_helper.rb