Hacker News new | ask | show | jobs
by twiss 1560 days ago
I think the difference is that, if x later becomes > 5, y doesn't suddenly get increased by 3.

By contrast, in CSS, if the condition later becomes true, the declarations in it do start to apply. So I also think "when" (in the sense of "whenever") makes more sense than "if".

1 comments

CSS is evaluated (probably) in some sort of event loop in the browser - you can also evaluate the code I included above in an event loop - there is nothing inherently instantaneous or continuous about CSS and, given that it is deterministic, it's only actually recalculated on certain event triggers.