cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FireFox does not respond to media queries in link tags

St-H
Making moves

Example

Let's say that I have a document like this:

 

 

<!DOCTYPE html>
<html>
    <head>
        <title>Example</title>
        <link rel="icon" href="/assets/images/icons/some-icon/white.svg" media="(prefers-color-scheme: dark)">
        <link rel="icon" href="/assets/images/icons/some-icon/black.svg" media="(prefers-color-scheme: light)">
    </head>
    <body>
        <h1>My title</h1>
        <p>Look at the icon!</p>
    </body>
</html>

 

Then regardless of whether or not the user is using dark, or light mode, the icon will
be black, even if that is not what is intended.

1 REPLY 1

jscher2000
Leader

Does that same media query work for external style sheets?