31 css import limit in IE 7

October 19th, 2009 by Richard G

This is more of a reminder to myself in case this slips my mind at some point in the future.

The BeautyTips module that I’m using for creating the help icon popup uses an external library called ExplorerCanvas to allow it to work in IE.

I’ve just found that IE 7, and probably the earlier ones too, have a limit on the number of CSS documents that can be imported into a document, this limit is 31. This then means that IE 7 can throw a javascript error if the javescript is trying to use createStyleSheet() which in my case happens on line 112 of excanvas.js. This will only be a problem in the development environment where CSS optimisation is disabled. The live site has this enabled and so there should never be a large number of CSS documents being importedand so no problem.

Leave a Reply