What is the best way to split css files for IE across assets: asset precompilation pipeline

I am using the CssSplitter CristianPeters module . And I hope that the split will happen during the assets: the precompilation task and the only way I have been successful so far is to fix Sprockets :: StaticCompiler. Hoping there is a better way to do this.

I appreciate any advice

+6
source share
2 answers

When you ran into this problem, I just split my manifest into 2:

  • has 1 for the base (reset, twitter bootstrap, ...) and
  • another for a specific CSS application
+1
source

If you write styles specifically for IE, it’s best not to combine them all together. So I would have a main manifest file where I would upload all my common style sheet files together and manifest 1/2/3 for IE (s) using conditional comments (http: //www.quirksmode. Org / css / condcom .html):

<%= stylesheet_link_tag :application %> // main manifest <!--[if IE 6]> <%= stylesheet_link_tag :ie6 %> // ie6 manifest <![endif]--> <!--[if IE 7]> .... 

thus, I would be sure that the css loading performance would not be damaged in browsers other than IE, and that my IE style sheets would not be loaded for different versions, (IE6 fixes in IE7, p.ex.).

+1
source

Source: https://habr.com/ru/post/915799/


All Articles