Questions tagged [darkmode]

General questions related to support of Dark Mode mode themes for OS, framework, and application programming.

Relating to programming for Dark Mode themes. Support of swapping from standard or default modes into Dark Mode.

As more OSes, frameworks, and programs support Light and Dark mode theme selection, programming to handle all theme cases gets complicated, especially on cross-platform apps.

566 questions
6
votes
1 answer

How to detect if a browser supports dark mode

We can use prefers-color-scheme: dark to detect if dark mode is activated or not: const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches; Is there a way detect if a browser supports dark mode at all? (By "supports dark mode" I…
vanowm
  • 9,466
  • 2
  • 21
  • 37
6
votes
1 answer

Prevent forcing dark mode in MIUI without increasing SDK version

My new app doesn't support dark mode. When I install it on Xiaomi (with dark mode truned on) MIUI applies dark mode on it. MIUI has settings at "Settings -> Display -> More Dark mode options" (screenshot of "More Dark mode options"). This options is…
TuranM
  • 63
  • 1
  • 4
5
votes
2 answers

light/dark mode in html, without CSS (only html)

it there a way to make the HTML elements be in dark mode if the user has activated in his system "dark mode" and if the user is like to use standard colors, to be "light mode" all this automatically when the user opens the website. without any…
stackdeveloper
  • 352
  • 2
  • 21
5
votes
2 answers

Why are image colors distorted in PyCharm?

I wanted to read in JPG with Pillow and then show it with imshow from matplotlib, but the image doesn't look like the original file. What's wrong? img = Image.open("my_pics/cat.jpg") arr = np.array(img) plt.imshow(arr)
Moritz Groß
  • 1,352
  • 12
  • 30
5
votes
4 answers

Body CSS not updating with .setProperty()

I am trying to enable a dark mode/light mode feature on a website, in which I am using the .setProperty function to change the HEX value of a variable. However, whenever I toggle a switch, the site does not update. Why is this? Here is all the code…
Bubbly
  • 301
  • 3
  • 11
5
votes
2 answers

Get the user-selected color theme in Github README

Is it possible to get the user-selected color theme in Github README? With the possibility of choosing a dark or light theme on Github, it would be useful to show figures on the README file (and other markdowns) accordingly. For instance, if the…
Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
5
votes
3 answers

Electron BrowserWindow switches to Dark Mode when opening DevTools

Dark Mode Confusion with DevTools I'm building an basic electron app from a tutorial. I have a BrowserWindow launching with some basic HTML and CSS Styling - Just the word "Awesome" in blue with a white background. However, my Windows and most apps…
LightCC
  • 9,804
  • 5
  • 52
  • 92
4
votes
1 answer

WebSettingsCompat.setAlgorithmicDarkeningAllowed does not work when targeting Android 33

I updated the targetSdk of my project to 33 and with that webkit to 1.6.0. In the migration guide (https://developer.android.com/about/versions/13/behavior-changes-13#webview-color-theme) it's mentioned to change from deprecated setForceDark to…
axstel
  • 111
  • 5
4
votes
2 answers

How disabled dark mode in tailwind css

I'm using the package laravel livewire table ([laravel livewire table][1] [1]: https://github.com/rappasoft/laravel-livewire-tables) on my laravel app (v8). I also use tailwind CSS on v3. By default this package add some tailwind class for dark mode…
Petitemo
  • 85
  • 2
  • 10
4
votes
2 answers

Change color of Bootstrap theme-colors in dark mode?

How can I change theme-colors (primary, secondary, etc.) in Bootstrap 5.X with sass only for dark mode? I get how I can change the primary color in both light and dark theme mode: custom.scss ... snip ... @import…
Elembivios
  • 113
  • 10
4
votes
5 answers

Is it possible to change color of toolbaritem more icon, hamburger icon and backbutton in .Net Maui?

I have a flyout master/detail page with .net maui. In dark mode, hamburger button, back button and toolbaritems more icon (three dots) appear in black on windwos. On Android, only the toolbaritems more icon (three dots) is black, the back button is…
S Arslan
  • 51
  • 1
  • 6
4
votes
1 answer

How can I change app theme with react-native Appearance and useColorScheme?

So Im trying to change the color scheme using Appearance or useColorScheme, but I was only able to get current theme. How to change it?
AlmaG3st
  • 192
  • 9
4
votes
1 answer

Where does firefox get the system theme from?

I am writing a bash script to switch system theme between dark and light whenever necessary (on Linux Mint 20.3). I could make it work for the overall OS theme, the terminal theme, and some gnome applications on flatpak. With this, I expected that…
kksagar
  • 267
  • 1
  • 3
  • 14
4
votes
2 answers

Why `window.matchMedia('(prefers-color-scheme: dark)').matches` returns `false` in Ubuntu Dark Mode

I'm using Ubuntu and trying to get the preferred theme of the user, by using matchMedia but it always returns false for this query. window.matchMedia('(prefers-color-scheme: dark)').matches // false
Mohamad Shiralizadeh
  • 8,329
  • 6
  • 58
  • 93
4
votes
1 answer

Firefox not respecting user media(prefers-color-scheme: dark)

I am using MediaWiki's Timeless CSS with the media query @media(prefers-color-scheme: dark) in order to display a dark site version to users who have a dark mode selection at the Operating System level. When I switch Dark or Light mode preference…
greektranslator
  • 499
  • 1
  • 6
  • 19
1
2
3
37 38