Re: [csswg-drafts] [css-conditional][css-mixins][css-cascade] How should global at-rules work inside of "contextual conditionals" like `@container`? (#12627)

The CSS Working Group just discussed ``[css-conditional][css-mixins][css-cascade] How should global at-rules work inside of "contextual conditionals" like `@container`?``, and agreed to the following:

* `RESOLVED: Treat contextual conditionals as always true for global rules i.e. the condition doesn't affect the rule`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> TabAtkins: Question is, if you put a global name-defining at-rule like @font-face or @mixin, into a contextual conditional like @container, which is defined at tree level, what happens?<br>
&lt;fantasai> TabAtkins: Right now browsers treat the condition as always true<br>
&lt;fantasai> TabAtkins: and I don't have a great reason to do any other behavior!<br>
&lt;fantasai> TabAtkins: so I propose adopting that officially -- for conditional rules that require tree information, like @condition, do allow global name-defining rules inside them, they are treated as always there<br>
&lt;romain> +1<br>
&lt;kizu> +1<br>
&lt;kbabbitt> fantasai: personally it seems a bit weird to treat it as always true<br>
&lt;kbabbitt> ... would have expected to treat it as always false<br>
&lt;kbabbitt> ... but if this feels intuitive to people like miriam, happy to defer<br>
&lt;romain> always true works well with at-import conditions<br>
&lt;fantasai> TabAtkins: Given always-true is established behavior, we'd have to worry about compat if we change to anything else<br>
&lt;kizu> q+<br>
&lt;flackr> q+<br>
&lt;romain> q+<br>
&lt;fantasai> miriam: I would have also expected always-false, but ok with this<br>
&lt;Rossen3> ack fantasai<br>
&lt;fantasai> miriam: either way it's teachable<br>
&lt;Rossen3> ack kizu<br>
&lt;fantasai> kizu: I think always-true is better for some cases, maybe not all<br>
&lt;flackr> +1<br>
&lt;romain> q-<br>
&lt;fantasai> kizu: My comment in issue was about @scope. When you have some stylesheet, it has global things, they apply, and you import the stylesheet but wrap it in scope, if it stops applying it would be bad<br>
&lt;fantasai> kizu: this is a bigger issue that we have a more namespacing thing such that you could conditionally wrap something like that<br>
&lt;fantasai> kizu: but for things that you could import, always true is better<br>
&lt;Rossen3> ack flackr<br>
&lt;fantasai> flackr: agreed, always true allows you to use at-defined names<br>
&lt;miriam> that argument makes sense to me<br>
&lt;fantasai> RESOLVED: Treat contextual conditionals as always true for global rules i.e. the condition doesn't affect the rule<br>
&lt;fantasai> +1, makes sense to me<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12627#issuecomment-3666535941 using your GitHub account


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

Received on Wednesday, 17 December 2025 18:02:37 UTC