Search code examples
ruby-on-railsstylesheet

Ruby on Rails conditional stylesheets


I was wondering if Ruby on Rails had a elegant way of displaying conditional stylesheets or do I need to use the default

    <!--[if IE 7]>
<link rel="stylesheet" href="css/ie7.css" type="text/css" media="screen" />
<![endif]-->

Solution

  • There's really no need for such a thing in Rails. It is really simple.

    But if you want to make it look better, you might consider Haml view engine.

    It allows you to do this:

    /[if IE 7]
      = stylesheet_link_tag 'ie7', :media => 'screen'