Web-Facing Change PSA: Support currentcolor in Relative Color Syntax

28 views
Skip to first unread message

Kevin Babbitt

unread,
Jun 24, 2024, 2:21:06 PM (5 days ago) Jun 24
to blink-dev

Contact emails

kbab...@microsoft.com

Specification

https://www.w3.org/TR/css-color-5/#resolving-rcs

Design docs
https://docs.google.com/document/d/1568wVjrIRbrU9_O37gPu10cj0CDWRiAc6ZMk9t0JpXs/edit

Summary

Allow relative colors in CSS (using the 'from' keyword) to use 'currentcolor' as a base. This will make it easy for web developers to set complementary colors, based on an element's text color, for that element's borders, shadows, backgrounds, etc.

 

Blink component

Blink>CSS

TAG review

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

TAG review status

Satisfied. The link above is for Relative Color Syntax in general. Tests for currentcolor cases were added as part of the discussion before the TAG signed off on the review; I interpret that to mean that they're satisfied with this use case.

 

Risks

 

Interoperability and Compatibility

Interoperability: Relative Color Syntax is a focus area for Interop 2024, and inclusion of currentcolor is well covered by existing WPTs, so the risk of other engines not converging on an interoperable implementation is low.

 

Compatibility: The only risk here is that enabling currentcolor support will "light up" color declarations that are being rejected at present. Total usage of Relative Color Syntax on the Web (including currentcolor or otherwise) is ~0.09% of page loads as of May 1, 2024[1]. I haven't done an analysis of currentcolor in RCS, but given that no major engine supported it as of that date, I would expect it to be a tiny fraction of those. [1] https://chromestatus.com/metrics/feature/timeline/popularity/4632



Gecko: Positive (https://github.com/mozilla/standards-positions/issues/841) Implementation bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1893966

WebKit: Shipped/Shipping (https://bugs.webkit.org/show_bug.cgi?id=245970) Changes landed May 13.

Web developers: Positive (https://github.com/web-platform-tests/interop/issues/426) This feature is part of Interop 2024.

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



Debuggability

Covered by existing DevTools support for debugging CSS properties.



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-color?label=master&label=experimental&aligned&view=interop&q=label%3Ainterop-2024-relative-color



Flag name on chrome://flags

None

Finch feature name

CSSRelativeColorSupportsCurrentcolor

Requires code in //chrome?

False

Tracking bug

https://issues.chromium.org/issues/325309578


Estimated milestones

Shipping on desktop

129

 

Shipping on Android

129

 

Shipping on WebView

129

 


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5307971793059840?gate=6194544847880192

This intent message was generated by Chrome Platform Status.

 

Reply all
Reply to author
Forward
0 new messages