IE hell

IE can only render 4095 selectors from an external CSS file

I ran across this today: apparently, Internet Explorer (all versions, not just IE 6) can only render a total of 4095 selectors from an external CSS file. After that, it simply starts ignoring the selectors. If you don't believe me, see the CSS rendering errors for yourself (only visible in IE, all versions).

This has been remarked on before, but it's definitely not common knowledge:

To the Drupal developer: Why should we care? How often could this happen, realistically?

It's actually not as far-fetched as you might think. Imagine a large site, with many areas. styles.css is getting huge, and you have some ancillary style sheets. Additionally, you have contributed modules which add CSS to every page. This happens; you can't always trust a module developer/maintainer to know what they're doing. Now, you turn on style sheet aggregation. Suddenly, you have one huge style sheet. If collectively there are more than 4095 selectors defined, you will end up with a bunch of rules that don't get rendered.

Fun times! Moral of the story is probably: keep your style sheets short and simple, keep an eye on what contributed modules are doing, and envision a world without IE, or at least where IE behaves a little more like we'd like it to.