Can I mod Vivaldi with CSS/JS to trigger @media (prefers-color-scheme:dark)?

172 Views Asked by At

I'm using Vivaldi on Linux Mint 21.2 Victoria (Xfce). As I understand it, even though I have a dark theme, my browser can't detect this, so web pages display by default on light mode. I'd like to have web pages display in dark mode using the @media (prefers-color-scheme:dark) query, not some extension or chromium flag that forces web pages into non-native dark mode. Is this possible using Vivaldi's CSS or JS modding capabilities?

I really have no clue where to start here. I'm just a hobbyist looking to modify my own viewing experience, and the other questions I've seen about overriding prefers-color-scheme prefs are from web developers looking to add a toggle or something on their websites.

Edit 2023/08/03

Here's an idea: in DevTools, I can use the Rendering tool and select "Enable automatic dark mode" to do what I'm looking for, which is setting prefers-color-scheme to dark. I can also use the "Emulate CSS media feature prefers-color-scheme" to do effectively the same thing. Is there a way to automate either of these settings to load on every web page? Of course, I'm still open to other solutions, especially those just involve native Vivaldi tinkering without DevTools.

0

There are 0 best solutions below