[csswg-drafts] [css-cascade] Allowing @import to be conditional on @supports queries

svgeesus has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-cascade] Allowing @import to be conditional on @supports queries ==
from https://lists.w3.org/Archives/Public/www-style/2015Jan/0292.html by @tabatkins 

> Right now, @import can only be made conditional on Media Queries, by
putting a media query after the URL in the rule.

> However, it would also be useful to let it be conditional on the
result of an @supports query.  That way, for example, one could send
some small, compact code using modern features, and if an @supports
query returns false, instead @import larger, more complicated code
(perhaps generated by a preprocessor from your base code) to do the
styling instead.  This avoids having to send both sets of styles to
most people; only down-level browses would have to spend the
additional bandwidth.

> I propose that we allow this by adding a
"supports(<supports-condition>)" function to the end @import grammar,
like:

> ```
> @import [ <url> | <string> ] [ <media-query-list> ||
> supports(<supports-condition>) ]? ;
> ```

> In other words, you can supply a media condition and/or a supports
condition.  If we add more conditional rules, we can add more to this
clause as well.

> Thoughts?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3165 using your GitHub account

Received on Wednesday, 26 September 2018 23:09:04 UTC