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
-1
votes
1 answer

[ Flutter "automatic" dark mode ]

Developing a new Flutter app, pretty consequent, and was wondering to add a dark mode. Is there such a library/package that would automatically apply a dark mode on your actual app? Like the "Dark Reader" google chrome plugin does on websites ? No…
Gob
  • 77
  • 7
-1
votes
1 answer

Switch to dark mode button

I have a template that sets dark mode only adding a class to the body. This template does not include a toggle button so I am trying to create it by myself but it goes back to light theme when I go to another file or reload the page. I am using a…
-1
votes
1 answer

How to opt out from dark mode on a MacOS app?

I want to set my swift app to always be in Light mode (to opposite to auto dark/light). All articles I could find on internet are for iOS and don't seem to work - being UIUserInterfaceStyle to Light,…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
-1
votes
2 answers

Automatic switch to dark mode

I maked manual dark mode button but this dont find how to do. How can make switch to dark mode after 9pm and then switch to light mode after 7am i use html, css and javascript? Thank you.
Milan_567
  • 11
  • 3
-1
votes
1 answer

iOS Dark Mode trait detection

override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if #available(iOS 13.0, *) { if traitCollection.hasDifferentColorAppearance(comparedTo:…
daredevil1234
  • 1,303
  • 1
  • 10
  • 34
-1
votes
1 answer

prefers-color-scheme default styles vs light

Can i use: @media (prefers-color-scheme: light) { color: pink; } @media (prefers-color-scheme: dark) { color: pink; } instead of: color: pink; @media (prefers-color-scheme: dark) { color: pink; } I know it's good to leave support for older…
Lolo Ogly
  • 11
  • 5
-1
votes
2 answers

The best way to manage colours in dark or light mode

At work we have a design system for our colours, for example red-1 red-2 red-3 green-1 green-2 green-3 The hex codes behind these might change, but also a component or set of components might, for example, change their colour from red-1 to red-2. We…
Matt Beaney
  • 460
  • 4
  • 15
-1
votes
1 answer

How to change HTML Attribude with JavaScript

I have a div where is an HTML Attribute called data-theme inside. I want to ask how do I change the value of the Attribute called data-theme. For example: From: data-theme="dark" to data-theme="light". The value is stored in a variable as a…
Niklas
  • 436
  • 1
  • 4
  • 16
-1
votes
1 answer

Is it possible set dark mode image in email?

I would like not only change text-colors but also various images and icons in the emails. Is it possible/shall I use media-query as the docs say? Shall I used display: none, display: block for images, in different night-day conditions? Will the…
János
  • 32,867
  • 38
  • 193
  • 353
-1
votes
2 answers

Is there a way to know whether the OS supports dark mode in a web page? (by JavaScript, CSS)

Is there anything like CSS.supports('dark-mode') ? I tried this: try { if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { // dark mode } } catch (e) { alert('do not support dark mode'); } But the…
AGamePlayer
  • 7,404
  • 19
  • 62
  • 119
-1
votes
1 answer

dark - light mode button

I want to change the body's bg to white, when it is set to "sun" (light mode) and change back to moon (also change the background to black with it) function dwmode(){ var body = document.querySelector('body') …
blnt09
  • 13
  • 3
-1
votes
1 answer

Why is my javascript not working in my navigation section?

So I made a JavaScript button to toggle dark mode on my page. The problem is that it works everywhere except for in my "navigation menu" section at the top of the page. Ideally, I would want the white text to change to black for all text in this…
-1
votes
1 answer

React: How can I dynamically change the entire background dynamically for light and dark mode? Redux holds my darkMode state

How can I dynamically change the entire background dynamically for light and dark mode? Redux holds my darkMode state. For instance, I want the background to be black when on darkMode and white when I'm not on darkMode. How can I dynamically adjust?…
jefelewis
  • 1,850
  • 1
  • 27
  • 63
-1
votes
1 answer

Viewing plaintext files in light mode in Firefox

I want to view a plaintext file in light color theme in Firefox. Firefox is showing the file in dark mode by default (I am using Firefox dark mode, and I don't want to change that). I could see the css code setting the theme, but could not edit it…
anotherone
  • 680
  • 1
  • 8
  • 23
-1
votes
3 answers

Adding a Darkmode Button

I would like to add a button to my app on the home screen, so that when you click on this button, the dark mode appears. Dark mode has already been set up and everything is running. However, only if the user of this app is also in dark mode with his…
1 2 3
37
38