[css-cascade] When an import rule fails to load or has an unsatisfied condition, does the layer still count? · Issue #6776 · w3c/csswg-drafts (original) (raw)

Consider @import rules below:

@import url(url-not-found.css) layer(A); @import url(sheet.css) layer(B) not all; @import url(sheet.css) layer(C) supports(display: invalid-value);

While these are valid but ineffective imports, do the layer declarations still count (and hence affect the global layer ordering)? The current spec seems unclear about it.

I suppose for conditional imports whose conditions evaluate to false, the layer declarations should not count, because nested @layer rules inside false media/supports rules do not count.

I'm unsure about imports that fail to load, though. We may count the layer for a stable global layer ordering, or do not counter the layer to be consistent with media/supports conditions. Either as a resolution will be fine for me.