Microsoft Edge breaks free: Introducing Dark Mode for iOS

It seems like Microsoft Edge's "Dark Mode" on iOS has a mind of its own. While it works as expected on Chrome, Safari, Firefox (iOS), and Chrome, Safari, Firefox, and Edge (OSX/Windows), I'm encountering some issues specifically with Edge on iOS.

Ideally, I would prefer for Edge not to use dark mode at all. If that's not possible, my next best option would be to target Edge's Dark Mode on iOS specifically and apply some CSS overrides. However, I've been struggling with this as Edge on iOS doesn't seem to pay attention to the "prefers-color-scheme: dark" property either.

To address this, I first added the following meta tag:

<meta name="color-scheme" content="only light">

Prior to that, I had used:

<meta name="color-scheme" content="light">

Additionally, I included the following CSS based on the Chromium spec from here:

:root {
    color-scheme: only light;
}

This solution worked perfectly in other environments, but unfortunately did not work on Edge iOS.

In an attempt to override this behavior, I utilized JavaScript to add a CSS target:

$(document).ready(function(){
    if (
        window.matchMedia &&&
        window.matchMedia('(prefers-color-scheme: dark)').matches &&
        /EdgiOS/.test(navigator.userAgent)
    ) {
        document.body.classList.add('ios-edge-dark');
    }
});

Along with CSS styling like this:

.ios-edge-dark {
        .hero-type-2 {
            .feature-icon {
                filter: $main-filter-neg;
            }
        }
}

Despite properly targeting Edge iOS and having functional code, there is a issue when the user is in InCognito-mode where the condition for Light Mode is mistakenly triggered.

To further investigate, I tested if Edge iOS would respond to a media query in CSS:

@media (prefers-color-scheme: dark) {
    .ios-edge-dark {
        .hero-type-2 {
            .feature-icon {
                filter: $main-filter-neg;
            }
        }
    }
}

However, Edge (iOS, InCognito) still behaves inconsistently. At this point, I am running out of ideas and beginning to feel reminiscent of dealing with IE issues.

I came across a post discussing similar problems but without a clear resolution: here

If anyone has a solution to this problem, I would greatly appreciate it! I am willing to try any workaround, even if it involves a messy JS-based approach like the one I attempted earlier. Thank you in advance!

P.S.: I have detailed the issue extensively in hopes of assisting others facing the same challenge. If you are experiencing similar difficulties, please share your attempts at finding a fix. I am open to adding those suggestions as well.

Answer №1

Have you tried activating dark mode in Edge settings? In my testing with Edge iOS, I found that the prefers-color-scheme feature detects the dark mode setting within Edge itself, not the overall iOS system.

To access this setting in Edge, simply click on the ☰ button located at the bottom right corner of the browser window, and then select Dark Mode. If you choose System default, the value of prefers-color-scheme will mirror the system-wide setting. On Edge for iOS, the prefers-color-scheme option specifically reflects the dark/light mode selected within the Edge settings.


Upon retesting, it appears that the issue persists within the iOS Edge InPrivate window. It seems likely that this is a bug within the iOS version of Edge, so providing feedback to the Edge team through Settings > Help and feedback would be beneficial.

It's important to note that Edge does not enforce dark mode; if you manually opt for "Dark Mode" within Edge, you can always disable this option by navigating to Hamburger menu ☰ > Settings > Appearance > Dark theme for all web pages.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

I faced a challenge when attempting to retrieve a JSON object with an XMLHttpRequest, causing the result to be an

My attempts to Fetch and Parse a JSON Object using XMLHttpRequest in Javascript are always unsuccessful, resulting in an empty quotation... function fetchAndParseJSON(target = null) { var response_data = []; ...

Retrieving an array of NSManagedObjects using objectID results in an empty array

Attempting to perform a fetch operation to retrieve managed objects from the context using an array of object IDs gathered from another context, but the result comes back as an empty array. Referencing the "Retrieving Specific Objects" section in the "Cor ...

Displaying a row number column in slickgrid: tips and tricks

Utilizing an ajax call, I am showcasing data in a slickgrid that resembles the following: india 564 usa 45454 japan 5454 The dataset I am retrieving does not include a column labeled 'Number' with row number values. How can I add a 'Numb ...

Changing selections in jQuery may not work properly on certain mobile and IE browsers

I am currently working on creating a dependency between two select boxes. The jQuery code I have implemented works perfectly on most common browsers such as Chrome and Firefox, but it seems to have some issues with Internet Explorer, Edge, and some mobile ...

Is the Amazon app utilizing the native webview for its functionality?

After reading numerous posts about the Amazon app heavily utilizing webviews, I decided to investigate for myself. (sources: - and ) Upon comparing the Amazon iOS app to the desktop website in mobile view, I noticed striking similarities. However, there ...

Using AngularJS to display multiple objects in the same ng-repeat loop

Is it possible to display two objects simultaneously in ng-repeat? <tr data-ng-repeat="target in targets |session in sessions |filter:query | orderBy:orderProp"> ...

The complete enclosure within the brackets

I am trying to enclose a div with text inside in brackets. I want the entire text (the div) to be surrounded by brackets. Here is an example of what I am looking for: https://i.sstatic.net/k4QRF.png I considered using border properties like top, bottom, ...

Issue with JS jQuery: The click event on an li element within an expanded ul does not function properly

I have built a basic webpage to explore jQuery. However, there is an issue that arises when I click on the "Button: another one." It seems to interfere with the event of clicking on the li element, causing it to glitch and not respond. Here is the code: JS ...

loading times of Bootstrap-select are slow when used in multiples

I am facing performance issues on my website when I try to include more than 20 select options. The jQuery execution slows down significantly and there is a stop/continue alert, taking minutes to load. Is there any way to optimize the code for faster loadi ...

Removing an item from JSON data using Node.js and Express

Currently, I am attempting to remove an entry from json data. In order to view the data, I utilize the following: app.route('/data/:id') .get((req:Request, res: Response) => { let id = req.params.id; res.status(200).send(projects ...

The hover effect in CSS is not altering the entire background

I'm looking to change the background color of a div when hovering over it, but I'm running into an issue where only the content inside the div is changing color. The rest of the background remains the same. Here's the HTML code I have: < ...

Do not use href for ngview change

I have been using ng-view to switch views by setting href="/..." in anchor tags and clicking on them. However, I am now looking for a way to change the view within the ng-view tag based on an event. Can anyone provide guidance on how to accomplish this? ...

``There is an issue with the onsubmit property that prevents the opening of

I have encountered an issue with my forms that has me stumped. Despite searching online for help, I can't seem to figure out why my implementation is not working as intended. The concept is straightforward. I've embedded a form within a JSP page ...

The AnchorEL component becomes unusable once a function has been executed for the first time

I am facing a challenge with anchorRef and struggling to understand how it works as I am new to React and have never used it before. After the onClickAway method is called, Material-UI shows an error stating that the anchorRef is set to null, but this warn ...

Issue with rendering HTML entities in Material UI when passing as props

Encountered a problem with the radio buttons in Material UI. Currently, Material UI accepts value as a prop for the FormControlLabel component. When passing a string with an HTML entity like below, it gets parsed correctly. <FormControlLabel value="fem ...

Using jQuery to fill input fields automatically with a mouse click rather than using the keyboard

I found a solution that works great for my needs here $("#EmailAddress").keyup(function(){ $("#Username").val(this.value); }); Even though this solution works perfectly when entering values with the keyboard, it doesn't seem to function properly ...

The function canOpenURL consistently returns a value of FALSE

Having some trouble opening a URL using UIApplication. Here's the code I'm running: [[UIApplication sharedApplication] canOpenURL:urlToUpdate The URL is generated from a String and NSString *urlStringToOpenEscaped = [urlStringToOpen stringByA ...

Special Table Spacing

Within my table, I am looking to create spacing between cells without setting padding and/or margin on each individual td. While using the CellSpacing and/or CellPadding properties of the table could be a potential solution, these properties apply space on ...

Monitor the DOM for visibility changes in Selenium WebDriver and PjantomJS before proceeding

I am currently creating automated test scripts using selenium-webdriver, phantomJS, and mocha. The script file I'm working with is a JavaScript file. My goal is to wait until an element (<a>) is fully visible before clicking on it. Let me pro ...

Subfolder is not generating the batch file

I need help troubleshooting this code. I created a temporary folder in the C drive, but for some reason the batch file isn't getting created. Can anyone provide some suggestions or insights? var sText, s; var fso = new ActiveXObject("Scripting.Fi ...