7 ms·
I believe the reason there's no if/else is because CSS is supposed to be easy enough to interpret relatively quickly (in a finite amount of time). The moment yo
by greggman3 4y ago
I believe the reason there's no if/else is because CSS is supposed to be easy enough to interpret relatively quickly (in a finite amount of time). The moment you add if/else you'd up with a full programming language and the halting problem and an arbitrary amount of calculations before the system can finally know what to render.
- erezsh 4y agoI think that would require while/recursion? Afaik ifs are very quick to calculate.
- valenterry 4y agoSo what's the issue here? Why is this not a problem for Javascript but for CSS? In the worst case just put a 3sec limit on the evaluation and stop it if it doesn't complete in time, problem solved.
- cal85 4y agoYou solved the halting problem!