[Webkit-unassigned] [Bug 283489] New: light-dark() function in SVG

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 21 07:42:21 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=283489

            Bug ID: 283489
           Summary: light-dark() function in SVG
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Mac (Apple Silicon)
                OS: macOS 15
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: oliverwilliams345 at gmail.com

If you have an SVG file with the following markup: 

<svg id="cloud" style="color-scheme: light dark;" xmlns="http://www.w3.org/2000/svg" fill="light-dark(red, blue)" viewBox="0 0 16 16">
  <path d="M4.158 12.025a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m-3.5 1.5a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 0 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m6 0a.5.5 0 0 1 .316.633l-.5 1.5a.5.5 0 1 1-.948-.316l.5-1.5a.5.5 0 0 1 .632-.317m.747-8.498a5.001 5.001 0 0 0-9.499-1.004A3.5 3.5 0 1 0 3.5 11H13a3 3 0 0 0 .405-5.973"/>
</svg>

In Firefox and Chrome, it will have a blue fill in dark mode and a red fill in light mode, even if the SVG is referenced using the HTML <img> tag: <img src="cloud.svg">

In Safari, the fill of the SVG is always red regardless of the users chosen color scheme.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241121/5eb0b06f/attachment.htm>


More information about the webkit-unassigned mailing list