Re: [csswg-drafts] [CSS Import Once] @import-once, or some syntax for importing a stylesheet only once (#6130)

> On first occurrence of @import-once "/some.css" it behaves just like @import.
> On every occurrence after that for the same URL (based on it's fully-qualified value), it is effectively skipped (no-op).

I think this would create a very unpredictable mental model when it comes to predicting the outcome of the cascade. Even in JS, it's not *exactly* how modules behave, since you still get the order of dependencies and exports, it's only the side effects and HTTP requests that are skipped.

I think we need a discussion about the use cases this is trying to solve. 
One component is that duplicate `@import`s should not fire more than 1 HTTP request. That is an internal optimization that doesn't require new syntax.
Is there more than that that use cases need? If so, I'd love to hear more about them!

-- 
GitHub Notification of comment by LeaVerou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6130#issuecomment-1975643478 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 4 March 2024 03:42:11 UTC