Darkmode.js icon indicating copy to clipboard operation
Darkmode.js copied to clipboard

Add the ability to pass in Color values

Open Adit-COCO-Garg opened this issue 5 years ago • 3 comments

Add the ability to pass in background color for dark mode and light mode. There seems to be little to no documentation on the methods or properties.

Adit-COCO-Garg avatar Dec 02 '19 18:12 Adit-COCO-Garg

Hi,

You can actually do it with those settings:

var options = {
  bottom: '64px', // default: '32px'
  right: 'unset', // default: '32px'
  left: '32px', // default: 'unset'
  time: '0.5s', // default: '0.3s'
  mixColor: '#fff', // default: '#fff'
  backgroundColor: '#fff',  // default: '#fff'
  buttonColorDark: '#100f2c',  // default: '#100f2c'
  buttonColorLight: '#fff', // default: '#fff'
  saveInCookies: false, // default: true,
  label: '🌓', // default: ''
  autoMatchOsTheme: true // default: true
}

sandoche avatar Dec 03 '19 16:12 sandoche

So what's happening here is that your base color - backgroundColor is being modified by the CSS blend mix. If I am using complex layouts and dynamic content delivery it becomes really difficult to manage ignoring appropriate modules as they constantly change and it messes up with images it turns them into negatives.

A future implementation could include being able to define a background color for both light and dark and find a way to not break layouts when trying to ignore certain modules of your document.

Adit-COCO-Garg avatar Dec 09 '19 20:12 Adit-COCO-Garg

Is there any way to configure the dark background color as something that's not black? (Like #ff2d2d30) I would like to use something similar as the Visual Studio Code dark theme background color, but I did not manage this with darkmode-js.

tobias-klein avatar Mar 13 '21 08:03 tobias-klein