Closed NV closed 12 years ago
Since I have to read a file (e.g. partial.css or http://usercss.ru/styles/night/night.css) it will be a platform-dependent. I need API to define how to do that. It might use XHR for browser environment. Don't know a good way to do it for Node.js yet.
I have a use case where it would be nice if the import wasn't actually performed per default, but added to the data structure alongside cssRules.
ditto, i need to handle the downloading my self. why not provide a callback that handles the downloading of imported sheets?
stef, yes, it will be a callback.
d7ac379d7f2ae3cbf727fda3a42e1569dc4c1807 Basic support of @import rules.
cssRules of imported stylesheet is always an empty array. Browsers behaves the same way when imported CSS is not found. If you need to parse imported stylesheet you can do it yourself by traversing a stylesheet, fetching CSSImportRule#href, parsing it and setting it back to CSSImportRule#styleSheet.
it works beautifully. Used it to add support for CSSImport relations in AssetGraph 665b6f3.
Thanks! Papandreou
thanks a lot! works here as well.
i find a lot of css on the web, where the import rule is without the 'url()' enclosure, like this: @import "/wp-content/themes/arclite/style.css";
there was a bug in the parser which prevented '"' enclosed urls to work, see stef/CSSOM@350c2a281aba8b471032
Spec. WebKit implementation: CSSImportRule.cpp.