Intent to Ship: CSS Custom Functions (@function)

754 visualizações
Pular para a primeira mensagem não lida

Anders Hartvoll Ruud

não lida,
25 de fev. de 2025, 12:26:2525 de fev.
para blink-dev

Contact emails

and...@chromium.org, se...@chromium.org


Explainer

https://css.oddbird.net/sasslike/mixins-functions

Note: the explainer includes a description of mixins as well. This intent covers custom functions (@function) only.


Specification

https://drafts.csswg.org/css-mixins-1


Note: despite its shortname (css-mixins), the spec currently describes custom functions only.


Summary

Custom Functions are similar to custom properties, but instead of returning a single fixed value, it returns a value based on other custom properties, parameters, and conditionals.


Example: Custom light-dark function:


@function --light-dark(--light, --dark) {

   result: var(--light);

   @media (prefers-color-scheme: dark) {

     result: var(--dark);

   }

}


div {

  background-image: --light-dark(black-logo.png, white-logo.png);

}


Blink component

Blink>CSS


TAG review

https://github.com/w3ctag/design-reviews/issues/1031


TAG review status

Pending


Risks



Interoperability and Compatibility

None



Gecko: No signal (https://github.com/mozilla/standards-positions/issues/1148)


WebKit: No signal (https://github.com/WebKit/standards-positions/issues/437)


Web developers: Positive


(Dug up what I could find per goo.gle/developer-signals):



Other signals:


WebView application risks

None



Debuggability

The Devtools team is working on “basic support” for @function: https://docs.google.com/document/d/17UCa0XDXAG9EBx18w1fXAA9SL3V9Lr4vTptaXYyE1CA/

Unfortunately that doc requires @google.com to access, but “basic support” primarily means that callsites can be clicked, you’ll be taken to the relevant function, and you’ll be able to edit the contents of the function.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes


Is this feature fully tested by web-platform-tests?

Yes


https://wpt.fyi/results/css/css-mixins



In both cases, I’ll make sure we get these things edited so we can remove the .tentative suffixes before shipping.


I do not plan to fix crbug.com/333965945 before shipping, which means that a failure on "Indexed property getter" is to be expected. I will not ship with any other test failures; unexpected red boxes on wpt.fyi may be considered temporary, usually due to Canary not having picked up the latest changes yet.


Flag name on about://flags

CSSFunctions


Finch feature name

CSSFunctions


Requires code in //chrome?

False


Tracking bug

https://issues.chromium.org/issues/325504770


Estimated milestones

Shipping on desktop

136

Shipping on Android

136

Shipping on WebView

136



Anticipated spec changes


At this point, I anticipate only one real spec change: disallowing argument values that begin with two dashes (‘--’). This is to make #11749 (named arguments) possible in the future without compat concerns.


All other issues are not interesting in terms of compat risk.


Full list (only the top one being interesting):



Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5179721933651968?gate=5074532782309376


Links to previous Intent discussions

Intent to Prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/b-BTxKD-Ldc/m/1pyobjq7AQAJ


Alan Stearns

não lida,
25 de fev. de 2025, 21:09:4525 de fev.
para blink-dev, and...@chromium.org
This is a feature that is greatly desired by developers, and as such runs increased risk that whatever gets shipped first gets heavily used and then cannot be improved due to web compat. I think it’s premature to ship without signals from other engines and without a TAG review. We should have more time with this feature behind a flag.

Another signal for implementing behind a feature flag for now: https://blog.kizu.dev/intent-to-experiment-for-longer/

Anders Hartvoll Ruud

não lida,
25 de fev. de 2025, 21:17:2325 de fev.
para Alan Stearns, Tab Atkins, blink-dev

Panos Astithas

não lida,
25 de fev. de 2025, 22:36:0525 de fev.
para Anders Hartvoll Ruud, Jeffrey Yasskin, Alan Stearns, Tab Atkins, blink-dev
@Jeffrey Yasskin can fix the outdated labels in the TAG review to ensure it gets in the review queue.

--
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+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAKFBnUofT%2BKD_b7r28JUJRdUgCs9HJaFhStgZsg8QyTUfJgR3Q%40mail.gmail.com.

Anders Hartvoll Ruud

não lida,
26 de fev. de 2025, 21:11:2326 de fev.
para Alan Stearns, kiz...@gmail.com, blink-dev, Tab Atkins
Note that this was targeting the M136 release, so we would have had another month to tweak this feature, and even a couple of weeks after that to land finishing touches (or to disable the feature, worst case).

As for signals, concerns could have been raised at any time between December 18th and now. TAG could easily have reviewed earlier, taking the one relevant pending change into account, but chose to delay (despite time constraints being communicated). (Unfortunate that I didn't pay attention to the GitHub labels, though - thanks for fixing that pastithas@ & jyasskin@).

That said, I do agree with the core concern here, so we'll retarget this for the M139 release (branching June 23rd). This intent can be considered "on hold" for now, and I'll be back in June with an update. Meanwhile, the Blink implementation (behind a flag) is ready for experimentation.

Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem