Contact emailsmoon...@google.com Explainer https://docs.google.com/document/d/1mbHBUR40jUBay7QZxgbjX7qixs5UZXkdL9tVwGvbmt0/edit?usp=sharing
Specificationhttps://drafts.csswg.org/css-values-5/#if-notation Summary The CSS if() function provides a concise way to express conditional values. It accepts a series of condition-value pairs, delimited by semicolons. The function evaluates each condition sequentially and returns the value associated with the first true condition. If none of the conditions evaluate to true, the function returns an empty token stream. This allows web authors to express complex conditional logic in a simple and concise way. Example: <style> div { color: var(--color); background-color: if(style(--color: white): black; else: white); } .dark { --color: black; } .light { --color: white; } </style> <div class="dark">dark</div> <div class="light">light</div> Blink componentBlink>CSS <https://issues.chromium.org/issues?q=customfield1222907:%22Blink%3ECSS%22> Motivation The CSS if() function provides a way for web authors to express complex conditional logic in a simple and concise way. The initial GitHub proposal had positive feedback from web developers. One of the use-cases might be using "if()" in custom functions, https://drafts.csswg.org/css-mixins-1/#defining-custom-functions. Initial public proposalhttps://github.com/w3c/csswg-drafts/issues/10064 TAG reviewNone TAG review statusPending Risks Interoperability and Compatibility None *Gecko*: No signal ( https://github.com/mozilla/standards-positions/issues/1167) *WebKit*: No signal ( https://github.com/WebKit/standards-positions/issues/453) *Web developers*: No signals *Other signals*: WebView application risks Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications? None DebuggabilityNone Is this feature fully tested by web-platform-tests <https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md> ?No Flag name on about://flagsNone Finch feature nameNone Non-finch justificationNone Requires code in //chrome?False Tracking bughttps://issues.chromium.org/issues/346977961 Estimated milestones No milestones specified Link to entry on the Chrome Platform Status https://chromestatus.com/feature/6313805904347136?gate=5132766385274880 This intent message was generated by Chrome Platform Status <https://chromestatus.com/>. -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAO7W_D9CCHOcXKNkbaVDFzUOWO7o9tcH1t7rS0xUaeKupYDTQ%40mail.gmail.com.