Bug 266049

Summary: [macOS] Switch control track is invisible on dark background
Product: WebKit Reporter: Tim Nguyen (:ntim) <ntim>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: annevk, cdumez, lwarlow, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 259380    

Tim Nguyen (:ntim)
Reported 2023-12-07 18:43:37 PST
data:text/html,<body bgcolor="black"><input type="checkbox" switch>
Attachments
Radar WebKit Bug Importer
Comment 1 2023-12-07 18:43:45 PST
Anne van Kesteren
Comment 2 2023-12-18 01:28:09 PST
It should work fine in dark mode, but that has to be explicitly enabled. I did not see that AppKit accounts for this, although it does allow control over both the track and thumb color individually, whereas the web platform only allows control over the track color.
Luke Warlow
Comment 3 2025-03-26 12:54:05 PDT
This seems to work fine if you set `color-scheme: dark` on the element. It's unclear why the background color of the switch would change dependent on the page's background colour? Perhaps AppKits switch is context aware somewhat? Is there a way to opt-out of that by default so the switch acts more like other controls (is light mode by default?)
Note You need to log in before you can comment on or make changes to this bug.