Support for @import
Closed this issue · 4 comments
Hello,
Seems skrollr-stylesheets doesn't parse style tags using imported stylesheets:
<style>@import url("foo.css?bar");</style>
Normally I would just use an external sheet via a link tag, but I am working on a drupal site, and the theme engine uses style tags by default like above.
Any way around this? There are a couple workarounds I could use for this specific application, but I think being able to use imports in style tags is probably a necessary feature for skrollr-stylesheets.
Thanks for an otherwise great set of libraries!
but I think being able to use imports in style tags is probably a necessary feature for skrollr-stylesheets
I personally have never, in my entire career, used @import
. I know there are some use cases for it, but it's not a replacement for <link>
.
I don't quite understand what keeps you from using links, I know nothing about drupal.
Oh, nothing's preventing me, I only need to hardcode it into my template or write a small function for my theme, I just prefer to keep things as vanilla as possible w Drupal and was surprised CSS imports weren't handled by skrollr-stylesheets. I believe Drupal uses imports to overcome some legacy IE issue. Thx for your quick response. :)
skrollr-stylesheets has a very basic parser which only extracts from the CSS what it needs. Support for @import
would be non-trivial to implement. Also @important
rules can be arbitrarily nested, where should this end?
Closing this since @import
rules are too complex to implement and are out of scope of what skrollr-stylesheets tries to do.