- From: Lea Verou via GitHub <sysbot+gh@w3.org>
- Date: Tue, 23 Jul 2024 11:44:14 +0000
- To: public-css-archive@w3.org
The downside of the publicity this issue got is many people are parachuting into it and confidently asserting they can solve all the problems without being aware of the numerous constraints we need to navigate for something like this to even be possible. ๐ @mindplay-dk Believe me, weโd all LOVE to do `@if` and do it properly, and [me more than anyone](https://github.com/w3c/csswg-drafts/issues/5624). However, there are currently technical constraints that prevent us from doing so, namely that we donโt want a rule that would have different behavior on descendants (like style queries) and different on the element itself (IACVT). Perhaps in the future it may become possible, if we implement something like #10443 to make IACVT behave as similarly to the regular cascade as possible. > for example, maybe we specify a simple two-phase evaluation, such that: > > 1. CSS properties are updated in the first phase, and > 2. custom properties are updated in a second phase. These are not independent, custom properties can depend on certain CSS properties, and CSS properties often depend on custom properties. Also, youโre proposing a very major change to how CSS is evaluated, and major changes require major benefit to be justifiable, otherwise they stand no chance of implementation. > I understand there is a potential for creating cycles with a feature like this, but... developers should know not to do that. ๐ Yeah, "users should just not do that" is not how you design a language (or any UI really). > Wouldn't it make more sense to take cues from established and popular languages such as SASS, where conditionals are structural concepts? Even when languages have block conditionals, they ALL also have some kind of inline conditional, because there are just so many use cases where only a small part of a value actually varies, and a block conditional would actually make code _less_ readable. Yes, [even Sass](https://sass-lang.com/documentation/modules/#if). ๐ > CSS is really all about thinking and designing in terms of structure. Is it now? ๐ -- GitHub Notification of comment by LeaVerou Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10064#issuecomment-2245012159 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 23 July 2024 11:44:20 UTC