question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background turned dark, but it didn't work for the texts

See original GitHub issue

Hi, thanks for your work!

I used Darkmode.js to add dark mode for my blog powered by VuePress. But in the dark mode, only the background turned black, while the text didn’t change at all, like the screenshot below, which looked very weird. In the meanwhile, the button didn’t appear the emoji 🌓 I added.

example

And I used the script as your instruction shows:

  1. Using NPM
npm install darkmode-js
  1. Add the javascript code and options:
// Dark Mode
import Darkmode from 'darkmode-js';

new Darkmode().showWidget();

var options = {
    label: '🌓'
}
  
const darkmode = new Darkmode(options);
darkmode.showWidget();

It would be great if you can help me about the problem. Thanks in advance 😊

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Nimita311commented, May 18, 2020

@madhavarshney Thank you for the fix. It is elegant. Within the same stacking context, any subsequent positioned element with a positive or an unspecified z-index will be inevitably stacked over the dark mode layer and cause problems. The dark mode layer really should have been given a positive z-index so that it is always at the top.

1reaction
sandochecommented, Dec 25, 2019

I will look into it to put it also in the library if it fits (and with the dynamic variables)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dark Mode New Problems -- selected text background color ...
If you want the white page permanently, go to File > Options > General and check the box for "Disable dark mode". https://jay-freedman.info....
Read more >
Somehow the dark theme has been turned on (black ...
Go to Settings.. battery and darken interface colours.. Settings, battery, and battery saver click on battery saver screen turns back white. My phone...
Read more >
Background changed to black using iOS 14.3 on iPhone 11
The background is black when I use apps like Message and email. It was white and I'm not sure why is changed to...
Read more >
Android - Dark mode issue: black text on dark background
Go to your activity_main.xml and set the textColor attributes of the TextViews whose colors remain black to
Read more >
How To Fix Outlook Dark Mode Problems (Email Design)
In this tutorial I'll explain how to stop the text in your HTML emails from changing color in Dark Mode in Outlook for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found