0

I'm working on a project that is fighting the IE 9 4096 rule limit bug. I'm trying to include all of the css that should be included by the manifest in an if IE 9 block:

<!--[if !(IE 9)]> -->
= stylesheet_link_tag  "application.css", :media => "all"
<!-- <![endif]-->

<!--[if IE 9]>
= stylesheet_link_tag "stylesheet1.css", :media => "all"
= stylesheet_link_tag "stylesheet2.css", :media => "all"
= stylesheet_link_tag "stylesheet3.css", :media => "all"
<![endif]-->

The problem seems to that either rake or Asset Pipeline or something seems to be injecting the application file invisible at the end of the [if IE 9] block.

TO BE CLEAR, THIS IS THE QUESTION, IT'S NOT ABOUT CONDITIONAL HAML*

It seems as though application.css is always required. Is this the case?

Is there a way to block it from getting injected when the HAML is compiled? (:plain works, but is hacky. you have to maintain a list)

Graham Bass
  • 126
  • 1
  • 9

1 Answers1

0

The comments in this SO Question led me to the answer. I used :plain to encapsulate the [if IE 9]. That prevented whatever weird processing was injecting application.css again. While it fixes it for now, I don't consider this maintainable in the long run.

:plain
  <!--[if IE 9]>
  = stylesheet_link_tag "stylesheet1.css", :media => "all"
  = stylesheet_link_tag "stylesheet2.css", :media => "all"
  = stylesheet_link_tag "stylesheet3.css", :media => "all"
  ...many more...
  <![endif]-->
Community
  • 1
  • 1
Graham Bass
  • 126
  • 1
  • 9