User Profile
dmatdialog
Copper Contributor
Joined Sep 01, 2023
User Widgets
Recent Discussions
Windows Outlook prefers-color-scheme
I've been using the snippet below to show/hide images if a client prefers dark-mode over default light-mode. Its been working great ever since I've put in place but recently it does not work for OL Office on any Windows (365 Windows 10, Mail Windows 11, Mail Windows 11). It works as intended on OL Office Mac or OL Office Web app. Is prefers-color-scheme still supported ? Using Windows 10 Pro Version 22H2 OS build 19045.3324 Windows Feature Experience Pack 1000.19041.1000.0 <!--Dark Mode image swap code. Works in Apple/iOS. Works on Outlook.com, but only if the images are linked--> <!--Styles--> <style> .dark-img { display: none !important; } @media (prefers-color-scheme:dark) { .dark-img { display: block !important; } .light-img { display: none !important; } } [data-ogsc] .dark-img { display: block !important; } [data-ogsc] .light-img { display: none !important; } </style> <!--HTML--> <a href=""><img class="light-img" src="https://via.placeholder.com/300x300" width="300" height="300" alt="" style="width: 100%; max-width: 300px; height: auto;" border="0" /> <!--[if !mso]><! --> <img class="dark-img" src="https://via.placeholder.com/200x200" width="200" height="200" alt="" style="width: 100%; max-width: 200px; height: auto;" border="0" /> <!--<![endif]--></a>2.9KViews0likes1Comment
Recent Blog Articles
No content to show