I love IE Conditional Comments… said no one ever!

Although it’s considered bad practice, sometimes we are left with no choice but to use IE conditional comments.

When you run into problems like style sheet limits in IE9 and below; supporting a maximum of 4095 rules per stylesheet, 31 @imports or having @import nesting up to 4 levels, you really don’t have a choice but to use IE conditional comments to split up your CSS file. Here is when IE conditional comments can be handy. (I would try to avoid it as much as possible though!)

Maintaining IE specific stylesheets can be a pain, especially for the scenario I’ve mentioned above like splitting up your CSS purely for IE. This can easily be solved by using grunt to compile your CSS into separate files. 

For those of you, like me, who do have to deal with these workarounds, here are some useful links:

One thing to note though that the condition comment for non IE browsers is a slightly different syntax!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s