Re: [csswg-drafts] [mediaqueries][css-conditional] else

@tabatkins -

Per my thoughts on scoping/namespace usage in issue #270 there's a potential reason to consider `@if` and `@when` separately.

inoas mentions 'timeless conditions'.  `@if` could be considered an instantaneous decision.  Once made, it leaves the table, and everything inside the block is evaluated without any further consideration of the initial condition.  If changes are made, the entire ruleset gets re-evaluated, and the new `@if` check has the same instantaneous property.

`@when`, on the other hand, implies an ongoing decision, which has two implications: First, that the condition might regularly change state (as you imply in your response there), and second, where everything within the block is evaluated while keeping that ongoing decision in mind.

However, most of the context of that differentiation comes from my idea that namespaces can be implemented almost entirely with existing tools, without needing to introduce a ton of extra semantics.  However I did realize by the end of it that it would require the `@when` condition be 'maintained' as a validity check for every selector within the conditional block (for conditionals which cannot be evaluated outside the context of a selector; namely, custom properties), and that's a subtle enough factor that it could impact the usability of the idea.

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

Received on Thursday, 13 April 2017 23:27:32 UTC