Re: [csswg-drafts] [mediaqueries-5][css-conditional-5][css-mixins-1] Order dependent rules and adopted stylesheets (#13041)

> What other things are order dependent?

None, this is something that we decided to do to avoid having to do multiple passes / dependency resolution / etc while going through the active styles, see https://github.com/w3c/csswg-drafts/issues/12536.

Alternatives were either strict lexical scoping (not great), forbidding conditional `@mixin` / `@custom-media` / etc (and somehow backtracking when you see a previously-undefined one), or specifying some sort algorithm to decide which one wins and which one applies at which point (any answer would be pretty arbitrary specially if we want to sort by `@layer`), plus hoping that implementing it is fast enough (which I'm a bit skeptical about but... hey).

I do think this is probably not an issue (authors already need to deal with most of this order issues and importing global styles first because specificity), but maybe we should discuss this at TPAC, or maybe there was a better solution that we didn't consider?

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


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

Received on Tuesday, 4 November 2025 22:13:17 UTC