Check this page - which further links to this one on quirksmode.org.
Thanks, but I have tried that... the Quirksmode examples never parse stylesheets embedded with @import.
If I have this HTML/CSS:
<link rel="stylesheet" type="text/css" href="css/test1.css" />
<style type="text/css">
@import url('css/test2.css');
div {
color: blue;
}
</style>
... then document.styleSheets.length is 2 (the link tag and the style tag). The CSS file that is linked through @import will be available as
document.styleSheets[1].cssRules[0].
In other words, a CSS rule. This can also be seen at the Quirksmode page that you mentioned, Christoph. I can get its cssText ("@import url('css/test2.css');") but I can't figure out how to parse the CSS inside the file (test2.css)...
If I have totally missed something obvious here, feel free to ridicule me... :)