Bug 243665

Summary: CSS `color-scheme` can't be assigned via CSS variable
Product: WebKit Reporter: Thomas Steiner <tomac>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: akeerthi, ntim
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Correct behavior in Chrome
none
Incorrect behavior in Safari none

Thomas Steiner
Reported 2022-08-08 05:45:32 PDT
Created attachment 461482 [details] Correct behavior in Chrome It's impossible in Safari to make the following CSS work: ```css :root { --color-scheme: dark light; color-scheme: var(--color-scheme); } ``` Go to https://aboard-bustling-bit.glitch.me/ in Safari and inspect the `<input>` with the value "Just a test". Note how the computed style for the `color-scheme` is always `auto`. Run the same test in Chrome and see how it reflects what is set via `var(--color-scheme)`.
Attachments
Correct behavior in Chrome (255.35 KB, image/png)
2022-08-08 05:45 PDT, Thomas Steiner
no flags
Incorrect behavior in Safari (186.81 KB, image/png)
2022-08-08 05:46 PDT, Thomas Steiner
no flags
Thomas Steiner
Comment 1 2022-08-08 05:46:05 PDT
Created attachment 461483 [details] Incorrect behavior in Safari
Tim Nguyen (:ntim)
Comment 2 2022-08-08 21:25:39 PDT
This seems fixed in tip of trunk.
Tim Nguyen (:ntim)
Comment 3 2022-08-08 21:28:14 PDT
I wonder if https://github.com/WebKit/WebKit/commit/5cd7506926c2b38de056ec7dec5c62d1a049c052 fixed it by avoiding applying the property twice.
Note You need to log in before you can comment on or make changes to this bug.