4 ms·
Because modern UI toolkits like Flutter proved that UI should just be code, not separated into three different languages. In this case, adding conditionals can
by tr45872267 10mo ago
Because modern UI toolkits like Flutter proved that UI should just be code, not separated into three different languages. In this case, adding conditionals can remove the need for js in some cases, which is good.
- ffsm8 10mo agoConsidering how this is seems to be designed... I don't think that's the reason? I mean looking at the mdn docs it's just a replacement for regular other syntax https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/if https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/V... So instead of having a css for x which defines e.g. dark mode and light mode separately, you can now define it via a single css rule. Where previously the "tree" forked at the beginning and attributes were set multiple times, depending on various criteria - now you set it once, and evaluate it's value depending on criteria div { background-image: if( style(--scheme: ice): linear-gradient(#caf0f8, white, #caf0f8); style(--scheme: fire): linear-gradient(#ffc971, white, #ffc971); else: none; ); } It looks like simple syntactic sugar to me
- tr45872267 10mo agoI should have read the docs for it then. Thanks.
- tambourine_man 10mo agoPlease provide evidence for that proof.